@cartanova/qgrid-cli 2.7.0 → 2.7.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 (1337) hide show
  1. package/README.ko.md +3 -2
  2. package/README.md +3 -2
  3. package/bundle/dist/_virtual/_rolldown/runtime.js +20 -1
  4. package/bundle/dist/application/monit/monit.frame.js +27 -14
  5. package/bundle/dist/application/monit/monit.types.js +22 -13
  6. package/bundle/dist/application/qgrid/conv-routing.js +21 -11
  7. package/bundle/dist/application/qgrid/oauth.js +1 -1
  8. package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +15 -4
  9. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +34 -14
  10. package/bundle/dist/application/qgrid/qgrid.frame.js +50 -73
  11. package/bundle/dist/application/qgrid/qgrid.types.js +4 -1
  12. package/bundle/dist/application/qgrid/schema-prompt.js +240 -0
  13. package/bundle/dist/application/qgrid/token-subscriber.js +5 -5
  14. package/bundle/dist/application/qgrid/tool-emulation-schema.js +13 -1
  15. package/bundle/dist/application/qgrid/tool-emulation.js +8 -6
  16. package/bundle/dist/application/queries.generated.js +3 -1
  17. package/bundle/dist/application/request-log/json-schema-type-text.js +55 -0
  18. package/bundle/dist/application/request-log/request-log.model.js +85 -3
  19. package/bundle/dist/application/request-log/request-log.types.js +3 -2
  20. package/bundle/dist/application/request-log/zod-code-format.js +71 -0
  21. package/bundle/dist/application/setting/setting.constant.js +2 -62
  22. package/bundle/dist/application/setting/setting.model.js +3 -3
  23. package/bundle/dist/application/setting/setting.store.js +2 -2
  24. package/bundle/dist/application/sonamu.generated.js +11 -4
  25. package/bundle/dist/application/sonamu.generated.sso.js +7 -3
  26. package/bundle/dist/i18n/sd.generated.js +5 -2
  27. package/bundle/dist/migrations/20260814130113_alter_request_logs_add1_alter1.js +15 -0
  28. package/bundle/dist/migrations/20260814131051_alter_request_logs_add1_alter1.js +15 -0
  29. package/bundle/dist/migrations/20260814134846_alter_request_logs_add1_alter1.js +15 -0
  30. package/bundle/dist/migrations/20260814140759_alter_request_logs_alter1.js +13 -0
  31. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +112 -0
  32. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +140 -0
  33. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +676 -0
  34. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
  35. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +104 -0
  36. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +225 -0
  37. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +30 -0
  38. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +20 -0
  39. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +135 -0
  40. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +63 -0
  41. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +148 -0
  42. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +25 -0
  43. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
  44. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +174 -0
  45. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +33 -0
  46. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +435 -0
  47. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +115 -0
  48. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +74 -0
  49. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +585 -0
  50. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +20 -0
  51. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +44 -0
  52. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +52 -0
  53. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +22 -0
  54. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +53 -0
  55. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +18 -0
  56. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +38 -0
  57. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +21 -0
  58. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +87 -0
  59. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +61 -0
  60. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +14 -0
  61. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +27 -0
  62. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +14 -0
  63. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +18 -0
  64. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +59 -0
  65. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +98 -0
  66. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +31 -0
  67. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +18 -0
  68. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +91 -0
  69. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +89 -0
  70. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +18 -0
  71. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +64 -0
  72. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +62 -0
  73. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +61 -0
  74. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +36 -0
  75. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +33 -0
  76. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +53 -0
  77. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +63 -0
  78. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +19 -0
  79. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
  80. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +43 -0
  81. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +19 -0
  82. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +132 -0
  83. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +16 -0
  84. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +24 -0
  85. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +114 -0
  86. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +103 -0
  87. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +16 -0
  88. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +37 -0
  89. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +48 -0
  90. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +47 -0
  91. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +24 -0
  92. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +22 -0
  93. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +17 -0
  94. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +94 -0
  95. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +12 -0
  96. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +25 -0
  97. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +21 -0
  98. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +15 -0
  99. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +48 -0
  100. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +61 -0
  101. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +29 -0
  102. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +19 -0
  103. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +51 -0
  104. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +50 -0
  105. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +20 -0
  106. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +30 -0
  107. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +35 -0
  108. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +49 -0
  109. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +30 -0
  110. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +29 -0
  111. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +40 -0
  112. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +74 -0
  113. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +72 -0
  114. package/bundle/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +35 -0
  115. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +238 -0
  116. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +189 -0
  117. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +284 -0
  118. package/bundle/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +80 -0
  119. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +9 -0
  120. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/benchmark.CX_oY03V.js +41 -0
  121. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/evaluatedModules.Dg1zASAC.js +19 -0
  122. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/index.Chj8NDwU.js +202 -0
  123. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/index.DdgEv5B1.js +46 -0
  124. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js +119 -0
  125. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/test.DNmyFkvJ.js +3044 -0
  126. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js +59 -0
  127. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_3892b4338df694f79f7d384fad23d930/node_modules/vitest/dist/index.js +28 -0
  128. package/bundle/dist/sonamu.config.js +10 -9
  129. package/bundle/dist/testing/schema-bench.js +0 -0
  130. package/bundle/dist/testing/setup-mocks.js +2 -2
  131. package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +14 -2
  132. package/bundle/dist/utils/providers/anthropic/claude-session.js +1 -1
  133. package/bundle/dist/utils/providers/anthropic/fence-strip.js +83 -0
  134. package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +3 -5
  135. package/bundle/dist/utils/providers/common/model-cost.js +1 -1
  136. package/bundle/dist/utils/providers/common/schema-validation.js +1 -1
  137. package/bundle/dist/utils/providers/openai/openai-backend-protocol.js +144 -0
  138. package/bundle/dist/utils/providers/openai/openai-constants.js +4 -2
  139. package/bundle/dist/utils/providers/openai/openai-direct-client.js +327 -0
  140. package/bundle/dist/utils/providers/openai/openai-dispatcher.js +358 -781
  141. package/bundle/dist/utils/providers/openai/openai-oauth.js +84 -0
  142. package/bundle/dist/utils/providers/openai/openai-quota.js +76 -5
  143. package/bundle/dist/utils/providers/openai/openai-refresh.js +3 -3
  144. package/bundle/dist/utils/providers/openai/openai-sse.js +72 -0
  145. package/bundle/dist/utils/providers/openai/openai-transport-config.js +14 -0
  146. package/bundle/src/application/monit/monit.frame.test.ts +14 -17
  147. package/bundle/src/application/monit/monit.frame.ts +23 -12
  148. package/bundle/src/application/monit/monit.types.ts +40 -11
  149. package/bundle/src/application/qgrid/conv-routing.test.ts +67 -0
  150. package/bundle/src/application/qgrid/conv-routing.ts +46 -12
  151. package/bundle/src/application/qgrid/qgrid-oauth-redirect.test.ts +92 -2
  152. package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +3 -0
  153. package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +15 -1
  154. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +286 -40
  155. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +58 -14
  156. package/bundle/src/application/qgrid/qgrid.frame.test.ts +120 -153
  157. package/bundle/src/application/qgrid/qgrid.frame.ts +57 -94
  158. package/bundle/src/application/qgrid/qgrid.types.ts +11 -4
  159. package/bundle/src/application/qgrid/schema-prompt.test.ts +166 -0
  160. package/bundle/src/application/qgrid/schema-prompt.ts +293 -0
  161. package/bundle/src/application/qgrid/token-subscriber.ts +4 -4
  162. package/bundle/src/application/qgrid/tool-emulation-schema.ts +1 -1
  163. package/bundle/src/application/qgrid/tool-emulation.test.ts +37 -0
  164. package/bundle/src/application/qgrid/tool-emulation.ts +19 -7
  165. package/bundle/src/application/queries.generated.ts +6 -0
  166. package/bundle/src/application/request-log/json-schema-type-text.test.ts +96 -0
  167. package/bundle/src/application/request-log/json-schema-type-text.ts +83 -0
  168. package/bundle/src/application/request-log/request-log.entity.json +147 -21
  169. package/bundle/src/application/request-log/request-log.model.ts +108 -0
  170. package/bundle/src/application/request-log/request-log.types.ts +2 -0
  171. package/bundle/src/application/request-log/zod-code-format.test.ts +31 -0
  172. package/bundle/src/application/request-log/zod-code-format.ts +73 -0
  173. package/bundle/src/application/setting/setting.constant.test.ts +22 -24
  174. package/bundle/src/application/setting/setting.constant.ts +2 -63
  175. package/bundle/src/application/setting/setting.entity.json +1 -1
  176. package/bundle/src/application/setting/setting.store.ts +1 -1
  177. package/bundle/src/application/sonamu.generated.http +20 -1
  178. package/bundle/src/application/sonamu.generated.sso.ts +4 -0
  179. package/bundle/src/application/sonamu.generated.ts +10 -0
  180. package/bundle/src/i18n/sd.generated.ts +6 -1
  181. package/bundle/src/migrations/20260814130113_alter_request_logs_add1_alter1.ts +15 -0
  182. package/bundle/src/migrations/20260814131051_alter_request_logs_add1_alter1.ts +15 -0
  183. package/bundle/src/migrations/20260814134846_alter_request_logs_add1_alter1.ts +15 -0
  184. package/bundle/src/migrations/20260814140759_alter_request_logs_alter1.ts +13 -0
  185. package/bundle/src/sonamu.config.ts +9 -13
  186. package/bundle/src/testing/schema-bench.test.ts +358 -0
  187. package/bundle/src/testing/schema-bench.ts +352 -0
  188. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +17 -2
  189. package/bundle/src/utils/providers/anthropic/claude-session.ts +1 -3
  190. package/bundle/src/utils/providers/anthropic/fence-strip.test.ts +122 -0
  191. package/bundle/src/utils/providers/anthropic/fence-strip.ts +105 -0
  192. package/bundle/src/utils/providers/anthropic/stream-json-adapter.test.ts +1 -2
  193. package/bundle/src/utils/providers/anthropic/stream-json-adapter.ts +4 -11
  194. package/bundle/src/utils/providers/common/model-cost.ts +4 -9
  195. package/bundle/src/utils/providers/common/provider-dispatcher.ts +10 -8
  196. package/bundle/src/utils/providers/common/provider-types.ts +48 -0
  197. package/bundle/src/utils/providers/common/schema-validation.ts +1 -1
  198. package/bundle/src/utils/providers/openai/openai-backend-protocol.test.ts +106 -0
  199. package/bundle/src/utils/providers/openai/openai-backend-protocol.ts +255 -0
  200. package/bundle/src/utils/providers/openai/openai-constants.ts +2 -0
  201. package/bundle/src/utils/providers/openai/openai-direct-client.test.ts +610 -0
  202. package/bundle/src/utils/providers/openai/openai-direct-client.ts +478 -0
  203. package/bundle/src/utils/providers/openai/openai-dispatcher.test.ts +336 -1723
  204. package/bundle/src/utils/providers/openai/openai-dispatcher.ts +458 -1175
  205. package/bundle/src/utils/providers/openai/openai-oauth.test.ts +95 -0
  206. package/bundle/src/utils/providers/openai/openai-oauth.ts +141 -0
  207. package/bundle/src/utils/providers/openai/openai-quota.test.ts +80 -7
  208. package/bundle/src/utils/providers/openai/openai-quota.ts +105 -4
  209. package/bundle/src/utils/providers/openai/openai-refresh.test.ts +120 -0
  210. package/bundle/src/utils/providers/openai/openai-refresh.ts +3 -1
  211. package/bundle/src/utils/providers/openai/openai-sse.test.ts +52 -0
  212. package/bundle/src/utils/providers/openai/openai-sse.ts +79 -0
  213. package/bundle/src/utils/providers/openai/openai-transport-config.ts +17 -0
  214. package/bundle/web-dist/client/assets/index-BldeEvAK.css +1 -0
  215. package/bundle/web-dist/client/assets/index-DkAXPF9q.js +106 -0
  216. package/bundle/web-dist/client/assets/logs-DlI6OojL.js +1 -0
  217. package/bundle/web-dist/client/assets/monit-qap66dhi.js +1 -0
  218. package/bundle/web-dist/client/assets/routes-CV07Pzde.js +5 -0
  219. package/bundle/web-dist/client/assets/services.generated-CSW8bhCP.js +51 -0
  220. package/bundle/web-dist/client/assets/settings-CdYub4yo.js +1 -0
  221. package/bundle/web-dist/client/assets/show-DA1L8DVD.js +2 -0
  222. package/bundle/web-dist/client/assets/tokens-Dt3gfkwP.js +1 -0
  223. package/bundle/web-dist/client/assets/use-oauth-login-flow-Cwi0HtJY.js +1 -0
  224. package/bundle/web-dist/client/index.html +3 -3
  225. package/bundle/web-dist/server/assets/lazyRouteComponent-0y-znAfz.js +1856 -0
  226. package/bundle/web-dist/server/assets/logs-CJBbHM3_.js +481 -0
  227. package/bundle/web-dist/server/assets/monit-8WAsPETB.js +1670 -0
  228. package/bundle/web-dist/server/assets/plus-9das21ju.js +19 -0
  229. package/bundle/web-dist/server/assets/react-dom-zmEq8BVp.js +462 -0
  230. package/bundle/web-dist/server/assets/routes-B6bX3o41.js +2924 -0
  231. package/bundle/web-dist/server/assets/services.generated-DyPeBI00.js +23644 -0
  232. package/bundle/web-dist/server/assets/settings-D1u5WdpP.js +597 -0
  233. package/bundle/web-dist/server/assets/show-Cr7vwR0l.js +2861 -0
  234. package/bundle/web-dist/server/assets/tokens-BumM0gnH.js +441 -0
  235. package/bundle/web-dist/server/assets/use-oauth-login-flow-DmsHGOlx.js +160 -0
  236. package/bundle/web-dist/server/entry-server.generated.js +12 -12
  237. package/dist/cli.d.ts +10 -1
  238. package/dist/cli.js +1 -6
  239. package/package.json +3 -2
  240. package/skills/qgrid/SKILL.md +5 -5
  241. package/skills/qgrid/references/ai-sdk-provider-contract.md +36 -25
  242. package/skills/qgrid/references/anthropic-claude-code-runtime.md +31 -14
  243. package/skills/qgrid/references/cli-env-and-server-boot.md +6 -13
  244. package/skills/qgrid/references/decision-rationale.md +28 -26
  245. package/skills/qgrid/references/docs-workflow.md +1 -1
  246. package/skills/qgrid/references/openai-codex-runtime.md +39 -156
  247. package/skills/qgrid/references/prompt-cache-and-usage.md +35 -68
  248. package/skills/qgrid/references/provider-runtime-differences.md +18 -18
  249. package/skills/qgrid/references/repo-map.md +2 -2
  250. package/skills/qgrid/references/request-log-run-lifecycle.md +12 -2
  251. package/skills/qgrid/references/sonamu-api-web-flow.md +4 -0
  252. package/skills/qgrid/references/token-auth-quota-lifecycle.md +14 -24
  253. package/skills/qgrid/references/tool-calling-and-multiturn.md +19 -9
  254. package/skills/qgrid/references/verification-and-debugging.md +17 -15
  255. package/bundle/dist/codex-protocol/AgentPath.js +0 -1
  256. package/bundle/dist/codex-protocol/ApplyPatchApprovalParams.js +0 -1
  257. package/bundle/dist/codex-protocol/ApplyPatchApprovalResponse.js +0 -1
  258. package/bundle/dist/codex-protocol/AuthMode.js +0 -1
  259. package/bundle/dist/codex-protocol/ClientInfo.js +0 -1
  260. package/bundle/dist/codex-protocol/ClientNotification.js +0 -1
  261. package/bundle/dist/codex-protocol/ClientRequest.js +0 -1
  262. package/bundle/dist/codex-protocol/CollaborationMode.js +0 -1
  263. package/bundle/dist/codex-protocol/ContentItem.js +0 -1
  264. package/bundle/dist/codex-protocol/ConversationGitInfo.js +0 -1
  265. package/bundle/dist/codex-protocol/ConversationSummary.js +0 -1
  266. package/bundle/dist/codex-protocol/ExecCommandApprovalParams.js +0 -1
  267. package/bundle/dist/codex-protocol/ExecCommandApprovalResponse.js +0 -1
  268. package/bundle/dist/codex-protocol/ExecPolicyAmendment.js +0 -1
  269. package/bundle/dist/codex-protocol/FileChange.js +0 -1
  270. package/bundle/dist/codex-protocol/ForcedLoginMethod.js +0 -1
  271. package/bundle/dist/codex-protocol/FunctionCallOutputBody.js +0 -1
  272. package/bundle/dist/codex-protocol/FunctionCallOutputContentItem.js +0 -1
  273. package/bundle/dist/codex-protocol/FuzzyFileSearchMatchType.js +0 -1
  274. package/bundle/dist/codex-protocol/FuzzyFileSearchParams.js +0 -1
  275. package/bundle/dist/codex-protocol/FuzzyFileSearchResponse.js +0 -1
  276. package/bundle/dist/codex-protocol/FuzzyFileSearchResult.js +0 -1
  277. package/bundle/dist/codex-protocol/FuzzyFileSearchSessionCompletedNotification.js +0 -1
  278. package/bundle/dist/codex-protocol/FuzzyFileSearchSessionUpdatedNotification.js +0 -1
  279. package/bundle/dist/codex-protocol/GetAuthStatusParams.js +0 -1
  280. package/bundle/dist/codex-protocol/GetAuthStatusResponse.js +0 -1
  281. package/bundle/dist/codex-protocol/GetConversationSummaryParams.js +0 -1
  282. package/bundle/dist/codex-protocol/GetConversationSummaryResponse.js +0 -1
  283. package/bundle/dist/codex-protocol/GitDiffToRemoteParams.js +0 -1
  284. package/bundle/dist/codex-protocol/GitDiffToRemoteResponse.js +0 -1
  285. package/bundle/dist/codex-protocol/GitSha.js +0 -1
  286. package/bundle/dist/codex-protocol/ImageDetail.js +0 -1
  287. package/bundle/dist/codex-protocol/InitializeCapabilities.js +0 -1
  288. package/bundle/dist/codex-protocol/InitializeParams.js +0 -1
  289. package/bundle/dist/codex-protocol/InitializeResponse.js +0 -1
  290. package/bundle/dist/codex-protocol/InputModality.js +0 -1
  291. package/bundle/dist/codex-protocol/InternalSessionSource.js +0 -1
  292. package/bundle/dist/codex-protocol/LocalShellAction.js +0 -1
  293. package/bundle/dist/codex-protocol/LocalShellExecAction.js +0 -1
  294. package/bundle/dist/codex-protocol/LocalShellStatus.js +0 -1
  295. package/bundle/dist/codex-protocol/MessagePhase.js +0 -1
  296. package/bundle/dist/codex-protocol/ModeKind.js +0 -1
  297. package/bundle/dist/codex-protocol/NetworkPolicyAmendment.js +0 -1
  298. package/bundle/dist/codex-protocol/NetworkPolicyRuleAction.js +0 -1
  299. package/bundle/dist/codex-protocol/ParsedCommand.js +0 -1
  300. package/bundle/dist/codex-protocol/Personality.js +0 -1
  301. package/bundle/dist/codex-protocol/PlanType.js +0 -1
  302. package/bundle/dist/codex-protocol/RealtimeConversationVersion.js +0 -1
  303. package/bundle/dist/codex-protocol/RealtimeOutputModality.js +0 -1
  304. package/bundle/dist/codex-protocol/RealtimeVoice.js +0 -1
  305. package/bundle/dist/codex-protocol/RealtimeVoicesList.js +0 -1
  306. package/bundle/dist/codex-protocol/ReasoningEffort.js +0 -1
  307. package/bundle/dist/codex-protocol/ReasoningItemContent.js +0 -1
  308. package/bundle/dist/codex-protocol/ReasoningItemReasoningSummary.js +0 -1
  309. package/bundle/dist/codex-protocol/ReasoningSummary.js +0 -1
  310. package/bundle/dist/codex-protocol/RequestId.js +0 -1
  311. package/bundle/dist/codex-protocol/Resource.js +0 -1
  312. package/bundle/dist/codex-protocol/ResourceContent.js +0 -1
  313. package/bundle/dist/codex-protocol/ResourceTemplate.js +0 -1
  314. package/bundle/dist/codex-protocol/ResponseItem.js +0 -1
  315. package/bundle/dist/codex-protocol/ReviewDecision.js +0 -1
  316. package/bundle/dist/codex-protocol/ServerNotification.js +0 -1
  317. package/bundle/dist/codex-protocol/ServerRequest.js +0 -1
  318. package/bundle/dist/codex-protocol/SessionSource.js +0 -1
  319. package/bundle/dist/codex-protocol/Settings.js +0 -1
  320. package/bundle/dist/codex-protocol/SubAgentSource.js +0 -1
  321. package/bundle/dist/codex-protocol/ThreadId.js +0 -1
  322. package/bundle/dist/codex-protocol/ThreadMemoryMode.js +0 -1
  323. package/bundle/dist/codex-protocol/Tool.js +0 -1
  324. package/bundle/dist/codex-protocol/Verbosity.js +0 -1
  325. package/bundle/dist/codex-protocol/WebSearchAction.js +0 -1
  326. package/bundle/dist/codex-protocol/WebSearchContextSize.js +0 -1
  327. package/bundle/dist/codex-protocol/WebSearchLocation.js +0 -1
  328. package/bundle/dist/codex-protocol/WebSearchMode.js +0 -1
  329. package/bundle/dist/codex-protocol/WebSearchToolConfig.js +0 -1
  330. package/bundle/dist/codex-protocol/index.js +0 -2
  331. package/bundle/dist/codex-protocol/serde_json/JsonValue.js +0 -1
  332. package/bundle/dist/codex-protocol/v2/Account.js +0 -1
  333. package/bundle/dist/codex-protocol/v2/AccountLoginCompletedNotification.js +0 -1
  334. package/bundle/dist/codex-protocol/v2/AccountRateLimitsUpdatedNotification.js +0 -1
  335. package/bundle/dist/codex-protocol/v2/AccountUpdatedNotification.js +0 -1
  336. package/bundle/dist/codex-protocol/v2/ActivePermissionProfile.js +0 -1
  337. package/bundle/dist/codex-protocol/v2/ActivePermissionProfileModification.js +0 -1
  338. package/bundle/dist/codex-protocol/v2/AddCreditsNudgeCreditType.js +0 -1
  339. package/bundle/dist/codex-protocol/v2/AddCreditsNudgeEmailStatus.js +0 -1
  340. package/bundle/dist/codex-protocol/v2/AdditionalFileSystemPermissions.js +0 -1
  341. package/bundle/dist/codex-protocol/v2/AdditionalNetworkPermissions.js +0 -1
  342. package/bundle/dist/codex-protocol/v2/AdditionalPermissionProfile.js +0 -1
  343. package/bundle/dist/codex-protocol/v2/AgentMessageDeltaNotification.js +0 -1
  344. package/bundle/dist/codex-protocol/v2/AnalyticsConfig.js +0 -1
  345. package/bundle/dist/codex-protocol/v2/AppBranding.js +0 -1
  346. package/bundle/dist/codex-protocol/v2/AppInfo.js +0 -1
  347. package/bundle/dist/codex-protocol/v2/AppListUpdatedNotification.js +0 -1
  348. package/bundle/dist/codex-protocol/v2/AppMetadata.js +0 -1
  349. package/bundle/dist/codex-protocol/v2/AppReview.js +0 -1
  350. package/bundle/dist/codex-protocol/v2/AppScreenshot.js +0 -1
  351. package/bundle/dist/codex-protocol/v2/AppSummary.js +0 -1
  352. package/bundle/dist/codex-protocol/v2/AppToolApproval.js +0 -1
  353. package/bundle/dist/codex-protocol/v2/AppToolsConfig.js +0 -1
  354. package/bundle/dist/codex-protocol/v2/ApprovalsReviewer.js +0 -1
  355. package/bundle/dist/codex-protocol/v2/AppsConfig.js +0 -1
  356. package/bundle/dist/codex-protocol/v2/AppsDefaultConfig.js +0 -1
  357. package/bundle/dist/codex-protocol/v2/AppsListParams.js +0 -1
  358. package/bundle/dist/codex-protocol/v2/AppsListResponse.js +0 -1
  359. package/bundle/dist/codex-protocol/v2/AskForApproval.js +0 -1
  360. package/bundle/dist/codex-protocol/v2/AutoReviewDecisionSource.js +0 -1
  361. package/bundle/dist/codex-protocol/v2/ByteRange.js +0 -1
  362. package/bundle/dist/codex-protocol/v2/CancelLoginAccountParams.js +0 -1
  363. package/bundle/dist/codex-protocol/v2/CancelLoginAccountResponse.js +0 -1
  364. package/bundle/dist/codex-protocol/v2/CancelLoginAccountStatus.js +0 -1
  365. package/bundle/dist/codex-protocol/v2/ChatgptAuthTokensRefreshParams.js +0 -1
  366. package/bundle/dist/codex-protocol/v2/ChatgptAuthTokensRefreshReason.js +0 -1
  367. package/bundle/dist/codex-protocol/v2/ChatgptAuthTokensRefreshResponse.js +0 -1
  368. package/bundle/dist/codex-protocol/v2/CodexErrorInfo.js +0 -1
  369. package/bundle/dist/codex-protocol/v2/CollabAgentState.js +0 -1
  370. package/bundle/dist/codex-protocol/v2/CollabAgentStatus.js +0 -1
  371. package/bundle/dist/codex-protocol/v2/CollabAgentTool.js +0 -1
  372. package/bundle/dist/codex-protocol/v2/CollabAgentToolCallStatus.js +0 -1
  373. package/bundle/dist/codex-protocol/v2/CollaborationModeMask.js +0 -1
  374. package/bundle/dist/codex-protocol/v2/CommandAction.js +0 -1
  375. package/bundle/dist/codex-protocol/v2/CommandExecOutputDeltaNotification.js +0 -1
  376. package/bundle/dist/codex-protocol/v2/CommandExecOutputStream.js +0 -1
  377. package/bundle/dist/codex-protocol/v2/CommandExecParams.js +0 -1
  378. package/bundle/dist/codex-protocol/v2/CommandExecResizeParams.js +0 -1
  379. package/bundle/dist/codex-protocol/v2/CommandExecResizeResponse.js +0 -1
  380. package/bundle/dist/codex-protocol/v2/CommandExecResponse.js +0 -1
  381. package/bundle/dist/codex-protocol/v2/CommandExecTerminalSize.js +0 -1
  382. package/bundle/dist/codex-protocol/v2/CommandExecTerminateParams.js +0 -1
  383. package/bundle/dist/codex-protocol/v2/CommandExecTerminateResponse.js +0 -1
  384. package/bundle/dist/codex-protocol/v2/CommandExecWriteParams.js +0 -1
  385. package/bundle/dist/codex-protocol/v2/CommandExecWriteResponse.js +0 -1
  386. package/bundle/dist/codex-protocol/v2/CommandExecutionApprovalDecision.js +0 -1
  387. package/bundle/dist/codex-protocol/v2/CommandExecutionOutputDeltaNotification.js +0 -1
  388. package/bundle/dist/codex-protocol/v2/CommandExecutionRequestApprovalParams.js +0 -1
  389. package/bundle/dist/codex-protocol/v2/CommandExecutionRequestApprovalResponse.js +0 -1
  390. package/bundle/dist/codex-protocol/v2/CommandExecutionSource.js +0 -1
  391. package/bundle/dist/codex-protocol/v2/CommandExecutionStatus.js +0 -1
  392. package/bundle/dist/codex-protocol/v2/CommandMigration.js +0 -1
  393. package/bundle/dist/codex-protocol/v2/Config.js +0 -1
  394. package/bundle/dist/codex-protocol/v2/ConfigBatchWriteParams.js +0 -1
  395. package/bundle/dist/codex-protocol/v2/ConfigEdit.js +0 -1
  396. package/bundle/dist/codex-protocol/v2/ConfigLayer.js +0 -1
  397. package/bundle/dist/codex-protocol/v2/ConfigLayerMetadata.js +0 -1
  398. package/bundle/dist/codex-protocol/v2/ConfigLayerSource.js +0 -1
  399. package/bundle/dist/codex-protocol/v2/ConfigReadParams.js +0 -1
  400. package/bundle/dist/codex-protocol/v2/ConfigReadResponse.js +0 -1
  401. package/bundle/dist/codex-protocol/v2/ConfigRequirements.js +0 -1
  402. package/bundle/dist/codex-protocol/v2/ConfigRequirementsReadResponse.js +0 -1
  403. package/bundle/dist/codex-protocol/v2/ConfigValueWriteParams.js +0 -1
  404. package/bundle/dist/codex-protocol/v2/ConfigWarningNotification.js +0 -1
  405. package/bundle/dist/codex-protocol/v2/ConfigWriteResponse.js +0 -1
  406. package/bundle/dist/codex-protocol/v2/ConfiguredHookHandler.js +0 -1
  407. package/bundle/dist/codex-protocol/v2/ConfiguredHookMatcherGroup.js +0 -1
  408. package/bundle/dist/codex-protocol/v2/ContextCompactedNotification.js +0 -1
  409. package/bundle/dist/codex-protocol/v2/CreditsSnapshot.js +0 -1
  410. package/bundle/dist/codex-protocol/v2/DeprecationNoticeNotification.js +0 -1
  411. package/bundle/dist/codex-protocol/v2/DynamicToolCallOutputContentItem.js +0 -1
  412. package/bundle/dist/codex-protocol/v2/DynamicToolCallParams.js +0 -1
  413. package/bundle/dist/codex-protocol/v2/DynamicToolCallResponse.js +0 -1
  414. package/bundle/dist/codex-protocol/v2/DynamicToolCallStatus.js +0 -1
  415. package/bundle/dist/codex-protocol/v2/DynamicToolSpec.js +0 -1
  416. package/bundle/dist/codex-protocol/v2/ErrorNotification.js +0 -1
  417. package/bundle/dist/codex-protocol/v2/ExecPolicyAmendment.js +0 -1
  418. package/bundle/dist/codex-protocol/v2/ExperimentalFeature.js +0 -1
  419. package/bundle/dist/codex-protocol/v2/ExperimentalFeatureEnablementSetParams.js +0 -1
  420. package/bundle/dist/codex-protocol/v2/ExperimentalFeatureEnablementSetResponse.js +0 -1
  421. package/bundle/dist/codex-protocol/v2/ExperimentalFeatureListParams.js +0 -1
  422. package/bundle/dist/codex-protocol/v2/ExperimentalFeatureListResponse.js +0 -1
  423. package/bundle/dist/codex-protocol/v2/ExperimentalFeatureStage.js +0 -1
  424. package/bundle/dist/codex-protocol/v2/ExternalAgentConfigDetectParams.js +0 -1
  425. package/bundle/dist/codex-protocol/v2/ExternalAgentConfigDetectResponse.js +0 -1
  426. package/bundle/dist/codex-protocol/v2/ExternalAgentConfigImportCompletedNotification.js +0 -1
  427. package/bundle/dist/codex-protocol/v2/ExternalAgentConfigImportParams.js +0 -1
  428. package/bundle/dist/codex-protocol/v2/ExternalAgentConfigImportResponse.js +0 -1
  429. package/bundle/dist/codex-protocol/v2/ExternalAgentConfigMigrationItem.js +0 -1
  430. package/bundle/dist/codex-protocol/v2/ExternalAgentConfigMigrationItemType.js +0 -1
  431. package/bundle/dist/codex-protocol/v2/FeedbackUploadParams.js +0 -1
  432. package/bundle/dist/codex-protocol/v2/FeedbackUploadResponse.js +0 -1
  433. package/bundle/dist/codex-protocol/v2/FileChangeApprovalDecision.js +0 -1
  434. package/bundle/dist/codex-protocol/v2/FileChangeOutputDeltaNotification.js +0 -1
  435. package/bundle/dist/codex-protocol/v2/FileChangePatchUpdatedNotification.js +0 -1
  436. package/bundle/dist/codex-protocol/v2/FileChangeRequestApprovalParams.js +0 -1
  437. package/bundle/dist/codex-protocol/v2/FileChangeRequestApprovalResponse.js +0 -1
  438. package/bundle/dist/codex-protocol/v2/FileSystemAccessMode.js +0 -1
  439. package/bundle/dist/codex-protocol/v2/FileSystemPath.js +0 -1
  440. package/bundle/dist/codex-protocol/v2/FileSystemSandboxEntry.js +0 -1
  441. package/bundle/dist/codex-protocol/v2/FileSystemSpecialPath.js +0 -1
  442. package/bundle/dist/codex-protocol/v2/FileUpdateChange.js +0 -1
  443. package/bundle/dist/codex-protocol/v2/FsChangedNotification.js +0 -1
  444. package/bundle/dist/codex-protocol/v2/FsCopyParams.js +0 -1
  445. package/bundle/dist/codex-protocol/v2/FsCopyResponse.js +0 -1
  446. package/bundle/dist/codex-protocol/v2/FsCreateDirectoryParams.js +0 -1
  447. package/bundle/dist/codex-protocol/v2/FsCreateDirectoryResponse.js +0 -1
  448. package/bundle/dist/codex-protocol/v2/FsGetMetadataParams.js +0 -1
  449. package/bundle/dist/codex-protocol/v2/FsGetMetadataResponse.js +0 -1
  450. package/bundle/dist/codex-protocol/v2/FsReadDirectoryEntry.js +0 -1
  451. package/bundle/dist/codex-protocol/v2/FsReadDirectoryParams.js +0 -1
  452. package/bundle/dist/codex-protocol/v2/FsReadDirectoryResponse.js +0 -1
  453. package/bundle/dist/codex-protocol/v2/FsReadFileParams.js +0 -1
  454. package/bundle/dist/codex-protocol/v2/FsReadFileResponse.js +0 -1
  455. package/bundle/dist/codex-protocol/v2/FsRemoveParams.js +0 -1
  456. package/bundle/dist/codex-protocol/v2/FsRemoveResponse.js +0 -1
  457. package/bundle/dist/codex-protocol/v2/FsUnwatchParams.js +0 -1
  458. package/bundle/dist/codex-protocol/v2/FsUnwatchResponse.js +0 -1
  459. package/bundle/dist/codex-protocol/v2/FsWatchParams.js +0 -1
  460. package/bundle/dist/codex-protocol/v2/FsWatchResponse.js +0 -1
  461. package/bundle/dist/codex-protocol/v2/FsWriteFileParams.js +0 -1
  462. package/bundle/dist/codex-protocol/v2/FsWriteFileResponse.js +0 -1
  463. package/bundle/dist/codex-protocol/v2/GetAccountParams.js +0 -1
  464. package/bundle/dist/codex-protocol/v2/GetAccountRateLimitsResponse.js +0 -1
  465. package/bundle/dist/codex-protocol/v2/GetAccountResponse.js +0 -1
  466. package/bundle/dist/codex-protocol/v2/GitInfo.js +0 -1
  467. package/bundle/dist/codex-protocol/v2/GrantedPermissionProfile.js +0 -1
  468. package/bundle/dist/codex-protocol/v2/GuardianApprovalReview.js +0 -1
  469. package/bundle/dist/codex-protocol/v2/GuardianApprovalReviewAction.js +0 -1
  470. package/bundle/dist/codex-protocol/v2/GuardianApprovalReviewStatus.js +0 -1
  471. package/bundle/dist/codex-protocol/v2/GuardianCommandSource.js +0 -1
  472. package/bundle/dist/codex-protocol/v2/GuardianRiskLevel.js +0 -1
  473. package/bundle/dist/codex-protocol/v2/GuardianUserAuthorization.js +0 -1
  474. package/bundle/dist/codex-protocol/v2/GuardianWarningNotification.js +0 -1
  475. package/bundle/dist/codex-protocol/v2/HookCompletedNotification.js +0 -1
  476. package/bundle/dist/codex-protocol/v2/HookErrorInfo.js +0 -1
  477. package/bundle/dist/codex-protocol/v2/HookEventName.js +0 -1
  478. package/bundle/dist/codex-protocol/v2/HookExecutionMode.js +0 -1
  479. package/bundle/dist/codex-protocol/v2/HookHandlerType.js +0 -1
  480. package/bundle/dist/codex-protocol/v2/HookMetadata.js +0 -1
  481. package/bundle/dist/codex-protocol/v2/HookMigration.js +0 -1
  482. package/bundle/dist/codex-protocol/v2/HookOutputEntry.js +0 -1
  483. package/bundle/dist/codex-protocol/v2/HookOutputEntryKind.js +0 -1
  484. package/bundle/dist/codex-protocol/v2/HookPromptFragment.js +0 -1
  485. package/bundle/dist/codex-protocol/v2/HookRunStatus.js +0 -1
  486. package/bundle/dist/codex-protocol/v2/HookRunSummary.js +0 -1
  487. package/bundle/dist/codex-protocol/v2/HookScope.js +0 -1
  488. package/bundle/dist/codex-protocol/v2/HookSource.js +0 -1
  489. package/bundle/dist/codex-protocol/v2/HookStartedNotification.js +0 -1
  490. package/bundle/dist/codex-protocol/v2/HookTrustStatus.js +0 -1
  491. package/bundle/dist/codex-protocol/v2/HooksListEntry.js +0 -1
  492. package/bundle/dist/codex-protocol/v2/HooksListParams.js +0 -1
  493. package/bundle/dist/codex-protocol/v2/HooksListResponse.js +0 -1
  494. package/bundle/dist/codex-protocol/v2/ItemCompletedNotification.js +0 -1
  495. package/bundle/dist/codex-protocol/v2/ItemGuardianApprovalReviewCompletedNotification.js +0 -1
  496. package/bundle/dist/codex-protocol/v2/ItemGuardianApprovalReviewStartedNotification.js +0 -1
  497. package/bundle/dist/codex-protocol/v2/ItemStartedNotification.js +0 -1
  498. package/bundle/dist/codex-protocol/v2/ListMcpServerStatusParams.js +0 -1
  499. package/bundle/dist/codex-protocol/v2/ListMcpServerStatusResponse.js +0 -1
  500. package/bundle/dist/codex-protocol/v2/LoginAccountParams.js +0 -1
  501. package/bundle/dist/codex-protocol/v2/LoginAccountResponse.js +0 -1
  502. package/bundle/dist/codex-protocol/v2/LogoutAccountResponse.js +0 -1
  503. package/bundle/dist/codex-protocol/v2/ManagedHooksRequirements.js +0 -1
  504. package/bundle/dist/codex-protocol/v2/MarketplaceAddParams.js +0 -1
  505. package/bundle/dist/codex-protocol/v2/MarketplaceAddResponse.js +0 -1
  506. package/bundle/dist/codex-protocol/v2/MarketplaceInterface.js +0 -1
  507. package/bundle/dist/codex-protocol/v2/MarketplaceLoadErrorInfo.js +0 -1
  508. package/bundle/dist/codex-protocol/v2/MarketplaceRemoveParams.js +0 -1
  509. package/bundle/dist/codex-protocol/v2/MarketplaceRemoveResponse.js +0 -1
  510. package/bundle/dist/codex-protocol/v2/MarketplaceUpgradeErrorInfo.js +0 -1
  511. package/bundle/dist/codex-protocol/v2/MarketplaceUpgradeParams.js +0 -1
  512. package/bundle/dist/codex-protocol/v2/MarketplaceUpgradeResponse.js +0 -1
  513. package/bundle/dist/codex-protocol/v2/McpAuthStatus.js +0 -1
  514. package/bundle/dist/codex-protocol/v2/McpElicitationArrayType.js +0 -1
  515. package/bundle/dist/codex-protocol/v2/McpElicitationBooleanSchema.js +0 -1
  516. package/bundle/dist/codex-protocol/v2/McpElicitationBooleanType.js +0 -1
  517. package/bundle/dist/codex-protocol/v2/McpElicitationConstOption.js +0 -1
  518. package/bundle/dist/codex-protocol/v2/McpElicitationEnumSchema.js +0 -1
  519. package/bundle/dist/codex-protocol/v2/McpElicitationLegacyTitledEnumSchema.js +0 -1
  520. package/bundle/dist/codex-protocol/v2/McpElicitationMultiSelectEnumSchema.js +0 -1
  521. package/bundle/dist/codex-protocol/v2/McpElicitationNumberSchema.js +0 -1
  522. package/bundle/dist/codex-protocol/v2/McpElicitationNumberType.js +0 -1
  523. package/bundle/dist/codex-protocol/v2/McpElicitationObjectType.js +0 -1
  524. package/bundle/dist/codex-protocol/v2/McpElicitationPrimitiveSchema.js +0 -1
  525. package/bundle/dist/codex-protocol/v2/McpElicitationSchema.js +0 -1
  526. package/bundle/dist/codex-protocol/v2/McpElicitationSingleSelectEnumSchema.js +0 -1
  527. package/bundle/dist/codex-protocol/v2/McpElicitationStringFormat.js +0 -1
  528. package/bundle/dist/codex-protocol/v2/McpElicitationStringSchema.js +0 -1
  529. package/bundle/dist/codex-protocol/v2/McpElicitationStringType.js +0 -1
  530. package/bundle/dist/codex-protocol/v2/McpElicitationTitledEnumItems.js +0 -1
  531. package/bundle/dist/codex-protocol/v2/McpElicitationTitledMultiSelectEnumSchema.js +0 -1
  532. package/bundle/dist/codex-protocol/v2/McpElicitationTitledSingleSelectEnumSchema.js +0 -1
  533. package/bundle/dist/codex-protocol/v2/McpElicitationUntitledEnumItems.js +0 -1
  534. package/bundle/dist/codex-protocol/v2/McpElicitationUntitledMultiSelectEnumSchema.js +0 -1
  535. package/bundle/dist/codex-protocol/v2/McpElicitationUntitledSingleSelectEnumSchema.js +0 -1
  536. package/bundle/dist/codex-protocol/v2/McpResourceReadParams.js +0 -1
  537. package/bundle/dist/codex-protocol/v2/McpResourceReadResponse.js +0 -1
  538. package/bundle/dist/codex-protocol/v2/McpServerElicitationAction.js +0 -1
  539. package/bundle/dist/codex-protocol/v2/McpServerElicitationRequestParams.js +0 -1
  540. package/bundle/dist/codex-protocol/v2/McpServerElicitationRequestResponse.js +0 -1
  541. package/bundle/dist/codex-protocol/v2/McpServerMigration.js +0 -1
  542. package/bundle/dist/codex-protocol/v2/McpServerOauthLoginCompletedNotification.js +0 -1
  543. package/bundle/dist/codex-protocol/v2/McpServerOauthLoginParams.js +0 -1
  544. package/bundle/dist/codex-protocol/v2/McpServerOauthLoginResponse.js +0 -1
  545. package/bundle/dist/codex-protocol/v2/McpServerRefreshResponse.js +0 -1
  546. package/bundle/dist/codex-protocol/v2/McpServerStartupState.js +0 -1
  547. package/bundle/dist/codex-protocol/v2/McpServerStatus.js +0 -1
  548. package/bundle/dist/codex-protocol/v2/McpServerStatusDetail.js +0 -1
  549. package/bundle/dist/codex-protocol/v2/McpServerStatusUpdatedNotification.js +0 -1
  550. package/bundle/dist/codex-protocol/v2/McpServerToolCallParams.js +0 -1
  551. package/bundle/dist/codex-protocol/v2/McpServerToolCallResponse.js +0 -1
  552. package/bundle/dist/codex-protocol/v2/McpToolCallError.js +0 -1
  553. package/bundle/dist/codex-protocol/v2/McpToolCallProgressNotification.js +0 -1
  554. package/bundle/dist/codex-protocol/v2/McpToolCallResult.js +0 -1
  555. package/bundle/dist/codex-protocol/v2/McpToolCallStatus.js +0 -1
  556. package/bundle/dist/codex-protocol/v2/MemoryCitation.js +0 -1
  557. package/bundle/dist/codex-protocol/v2/MemoryCitationEntry.js +0 -1
  558. package/bundle/dist/codex-protocol/v2/MergeStrategy.js +0 -1
  559. package/bundle/dist/codex-protocol/v2/MigrationDetails.js +0 -1
  560. package/bundle/dist/codex-protocol/v2/Model.js +0 -1
  561. package/bundle/dist/codex-protocol/v2/ModelAvailabilityNux.js +0 -1
  562. package/bundle/dist/codex-protocol/v2/ModelListParams.js +0 -1
  563. package/bundle/dist/codex-protocol/v2/ModelListResponse.js +0 -1
  564. package/bundle/dist/codex-protocol/v2/ModelProviderCapabilitiesReadParams.js +0 -1
  565. package/bundle/dist/codex-protocol/v2/ModelProviderCapabilitiesReadResponse.js +0 -1
  566. package/bundle/dist/codex-protocol/v2/ModelRerouteReason.js +0 -1
  567. package/bundle/dist/codex-protocol/v2/ModelReroutedNotification.js +0 -1
  568. package/bundle/dist/codex-protocol/v2/ModelServiceTier.js +0 -1
  569. package/bundle/dist/codex-protocol/v2/ModelUpgradeInfo.js +0 -1
  570. package/bundle/dist/codex-protocol/v2/ModelVerification.js +0 -1
  571. package/bundle/dist/codex-protocol/v2/ModelVerificationNotification.js +0 -1
  572. package/bundle/dist/codex-protocol/v2/NetworkAccess.js +0 -1
  573. package/bundle/dist/codex-protocol/v2/NetworkApprovalContext.js +0 -1
  574. package/bundle/dist/codex-protocol/v2/NetworkApprovalProtocol.js +0 -1
  575. package/bundle/dist/codex-protocol/v2/NetworkDomainPermission.js +0 -1
  576. package/bundle/dist/codex-protocol/v2/NetworkPolicyAmendment.js +0 -1
  577. package/bundle/dist/codex-protocol/v2/NetworkPolicyRuleAction.js +0 -1
  578. package/bundle/dist/codex-protocol/v2/NetworkRequirements.js +0 -1
  579. package/bundle/dist/codex-protocol/v2/NetworkUnixSocketPermission.js +0 -1
  580. package/bundle/dist/codex-protocol/v2/NonSteerableTurnKind.js +0 -1
  581. package/bundle/dist/codex-protocol/v2/OverriddenMetadata.js +0 -1
  582. package/bundle/dist/codex-protocol/v2/PatchApplyStatus.js +0 -1
  583. package/bundle/dist/codex-protocol/v2/PatchChangeKind.js +0 -1
  584. package/bundle/dist/codex-protocol/v2/PermissionGrantScope.js +0 -1
  585. package/bundle/dist/codex-protocol/v2/PermissionProfile.js +0 -1
  586. package/bundle/dist/codex-protocol/v2/PermissionProfileFileSystemPermissions.js +0 -1
  587. package/bundle/dist/codex-protocol/v2/PermissionProfileModificationParams.js +0 -1
  588. package/bundle/dist/codex-protocol/v2/PermissionProfileNetworkPermissions.js +0 -1
  589. package/bundle/dist/codex-protocol/v2/PermissionProfileSelectionParams.js +0 -1
  590. package/bundle/dist/codex-protocol/v2/PermissionsRequestApprovalParams.js +0 -1
  591. package/bundle/dist/codex-protocol/v2/PermissionsRequestApprovalResponse.js +0 -1
  592. package/bundle/dist/codex-protocol/v2/PlanDeltaNotification.js +0 -1
  593. package/bundle/dist/codex-protocol/v2/PluginAuthPolicy.js +0 -1
  594. package/bundle/dist/codex-protocol/v2/PluginAvailability.js +0 -1
  595. package/bundle/dist/codex-protocol/v2/PluginDetail.js +0 -1
  596. package/bundle/dist/codex-protocol/v2/PluginHookSummary.js +0 -1
  597. package/bundle/dist/codex-protocol/v2/PluginInstallParams.js +0 -1
  598. package/bundle/dist/codex-protocol/v2/PluginInstallPolicy.js +0 -1
  599. package/bundle/dist/codex-protocol/v2/PluginInstallResponse.js +0 -1
  600. package/bundle/dist/codex-protocol/v2/PluginInterface.js +0 -1
  601. package/bundle/dist/codex-protocol/v2/PluginListMarketplaceKind.js +0 -1
  602. package/bundle/dist/codex-protocol/v2/PluginListParams.js +0 -1
  603. package/bundle/dist/codex-protocol/v2/PluginListResponse.js +0 -1
  604. package/bundle/dist/codex-protocol/v2/PluginMarketplaceEntry.js +0 -1
  605. package/bundle/dist/codex-protocol/v2/PluginReadParams.js +0 -1
  606. package/bundle/dist/codex-protocol/v2/PluginReadResponse.js +0 -1
  607. package/bundle/dist/codex-protocol/v2/PluginShareContext.js +0 -1
  608. package/bundle/dist/codex-protocol/v2/PluginShareDeleteParams.js +0 -1
  609. package/bundle/dist/codex-protocol/v2/PluginShareDeleteResponse.js +0 -1
  610. package/bundle/dist/codex-protocol/v2/PluginShareDiscoverability.js +0 -1
  611. package/bundle/dist/codex-protocol/v2/PluginShareListItem.js +0 -1
  612. package/bundle/dist/codex-protocol/v2/PluginShareListParams.js +0 -1
  613. package/bundle/dist/codex-protocol/v2/PluginShareListResponse.js +0 -1
  614. package/bundle/dist/codex-protocol/v2/PluginSharePrincipal.js +0 -1
  615. package/bundle/dist/codex-protocol/v2/PluginSharePrincipalType.js +0 -1
  616. package/bundle/dist/codex-protocol/v2/PluginShareSaveParams.js +0 -1
  617. package/bundle/dist/codex-protocol/v2/PluginShareSaveResponse.js +0 -1
  618. package/bundle/dist/codex-protocol/v2/PluginShareTarget.js +0 -1
  619. package/bundle/dist/codex-protocol/v2/PluginShareUpdateDiscoverability.js +0 -1
  620. package/bundle/dist/codex-protocol/v2/PluginShareUpdateTargetsParams.js +0 -1
  621. package/bundle/dist/codex-protocol/v2/PluginShareUpdateTargetsResponse.js +0 -1
  622. package/bundle/dist/codex-protocol/v2/PluginSkillReadParams.js +0 -1
  623. package/bundle/dist/codex-protocol/v2/PluginSkillReadResponse.js +0 -1
  624. package/bundle/dist/codex-protocol/v2/PluginSource.js +0 -1
  625. package/bundle/dist/codex-protocol/v2/PluginSummary.js +0 -1
  626. package/bundle/dist/codex-protocol/v2/PluginUninstallParams.js +0 -1
  627. package/bundle/dist/codex-protocol/v2/PluginUninstallResponse.js +0 -1
  628. package/bundle/dist/codex-protocol/v2/PluginsMigration.js +0 -1
  629. package/bundle/dist/codex-protocol/v2/ProcessExitedNotification.js +0 -1
  630. package/bundle/dist/codex-protocol/v2/ProcessOutputDeltaNotification.js +0 -1
  631. package/bundle/dist/codex-protocol/v2/ProcessOutputStream.js +0 -1
  632. package/bundle/dist/codex-protocol/v2/ProcessTerminalSize.js +0 -1
  633. package/bundle/dist/codex-protocol/v2/ProfileV2.js +0 -1
  634. package/bundle/dist/codex-protocol/v2/RateLimitReachedType.js +0 -1
  635. package/bundle/dist/codex-protocol/v2/RateLimitSnapshot.js +0 -1
  636. package/bundle/dist/codex-protocol/v2/RateLimitWindow.js +0 -1
  637. package/bundle/dist/codex-protocol/v2/RawResponseItemCompletedNotification.js +0 -1
  638. package/bundle/dist/codex-protocol/v2/ReasoningEffortOption.js +0 -1
  639. package/bundle/dist/codex-protocol/v2/ReasoningSummaryPartAddedNotification.js +0 -1
  640. package/bundle/dist/codex-protocol/v2/ReasoningSummaryTextDeltaNotification.js +0 -1
  641. package/bundle/dist/codex-protocol/v2/ReasoningTextDeltaNotification.js +0 -1
  642. package/bundle/dist/codex-protocol/v2/RemoteControlConnectionStatus.js +0 -1
  643. package/bundle/dist/codex-protocol/v2/RemoteControlStatusChangedNotification.js +0 -1
  644. package/bundle/dist/codex-protocol/v2/RequestPermissionProfile.js +0 -1
  645. package/bundle/dist/codex-protocol/v2/ResidencyRequirement.js +0 -1
  646. package/bundle/dist/codex-protocol/v2/ReviewDelivery.js +0 -1
  647. package/bundle/dist/codex-protocol/v2/ReviewStartParams.js +0 -1
  648. package/bundle/dist/codex-protocol/v2/ReviewStartResponse.js +0 -1
  649. package/bundle/dist/codex-protocol/v2/ReviewTarget.js +0 -1
  650. package/bundle/dist/codex-protocol/v2/SandboxMode.js +0 -1
  651. package/bundle/dist/codex-protocol/v2/SandboxPolicy.js +0 -1
  652. package/bundle/dist/codex-protocol/v2/SandboxWorkspaceWrite.js +0 -1
  653. package/bundle/dist/codex-protocol/v2/SendAddCreditsNudgeEmailParams.js +0 -1
  654. package/bundle/dist/codex-protocol/v2/SendAddCreditsNudgeEmailResponse.js +0 -1
  655. package/bundle/dist/codex-protocol/v2/ServerRequestResolvedNotification.js +0 -1
  656. package/bundle/dist/codex-protocol/v2/SessionMigration.js +0 -1
  657. package/bundle/dist/codex-protocol/v2/SessionSource.js +0 -1
  658. package/bundle/dist/codex-protocol/v2/SkillDependencies.js +0 -1
  659. package/bundle/dist/codex-protocol/v2/SkillErrorInfo.js +0 -1
  660. package/bundle/dist/codex-protocol/v2/SkillInterface.js +0 -1
  661. package/bundle/dist/codex-protocol/v2/SkillMetadata.js +0 -1
  662. package/bundle/dist/codex-protocol/v2/SkillScope.js +0 -1
  663. package/bundle/dist/codex-protocol/v2/SkillSummary.js +0 -1
  664. package/bundle/dist/codex-protocol/v2/SkillToolDependency.js +0 -1
  665. package/bundle/dist/codex-protocol/v2/SkillsChangedNotification.js +0 -1
  666. package/bundle/dist/codex-protocol/v2/SkillsConfigWriteParams.js +0 -1
  667. package/bundle/dist/codex-protocol/v2/SkillsConfigWriteResponse.js +0 -1
  668. package/bundle/dist/codex-protocol/v2/SkillsListEntry.js +0 -1
  669. package/bundle/dist/codex-protocol/v2/SkillsListParams.js +0 -1
  670. package/bundle/dist/codex-protocol/v2/SkillsListResponse.js +0 -1
  671. package/bundle/dist/codex-protocol/v2/SortDirection.js +0 -1
  672. package/bundle/dist/codex-protocol/v2/SubagentMigration.js +0 -1
  673. package/bundle/dist/codex-protocol/v2/TerminalInteractionNotification.js +0 -1
  674. package/bundle/dist/codex-protocol/v2/TextElement.js +0 -1
  675. package/bundle/dist/codex-protocol/v2/TextPosition.js +0 -1
  676. package/bundle/dist/codex-protocol/v2/TextRange.js +0 -1
  677. package/bundle/dist/codex-protocol/v2/Thread.js +0 -1
  678. package/bundle/dist/codex-protocol/v2/ThreadActiveFlag.js +0 -1
  679. package/bundle/dist/codex-protocol/v2/ThreadApproveGuardianDeniedActionParams.js +0 -1
  680. package/bundle/dist/codex-protocol/v2/ThreadApproveGuardianDeniedActionResponse.js +0 -1
  681. package/bundle/dist/codex-protocol/v2/ThreadArchiveParams.js +0 -1
  682. package/bundle/dist/codex-protocol/v2/ThreadArchiveResponse.js +0 -1
  683. package/bundle/dist/codex-protocol/v2/ThreadArchivedNotification.js +0 -1
  684. package/bundle/dist/codex-protocol/v2/ThreadClosedNotification.js +0 -1
  685. package/bundle/dist/codex-protocol/v2/ThreadCompactStartParams.js +0 -1
  686. package/bundle/dist/codex-protocol/v2/ThreadCompactStartResponse.js +0 -1
  687. package/bundle/dist/codex-protocol/v2/ThreadForkParams.js +0 -1
  688. package/bundle/dist/codex-protocol/v2/ThreadForkResponse.js +0 -1
  689. package/bundle/dist/codex-protocol/v2/ThreadGoal.js +0 -1
  690. package/bundle/dist/codex-protocol/v2/ThreadGoalClearedNotification.js +0 -1
  691. package/bundle/dist/codex-protocol/v2/ThreadGoalStatus.js +0 -1
  692. package/bundle/dist/codex-protocol/v2/ThreadGoalUpdatedNotification.js +0 -1
  693. package/bundle/dist/codex-protocol/v2/ThreadInjectItemsParams.js +0 -1
  694. package/bundle/dist/codex-protocol/v2/ThreadInjectItemsResponse.js +0 -1
  695. package/bundle/dist/codex-protocol/v2/ThreadItem.js +0 -1
  696. package/bundle/dist/codex-protocol/v2/ThreadListParams.js +0 -1
  697. package/bundle/dist/codex-protocol/v2/ThreadListResponse.js +0 -1
  698. package/bundle/dist/codex-protocol/v2/ThreadLoadedListParams.js +0 -1
  699. package/bundle/dist/codex-protocol/v2/ThreadLoadedListResponse.js +0 -1
  700. package/bundle/dist/codex-protocol/v2/ThreadMetadataGitInfoUpdateParams.js +0 -1
  701. package/bundle/dist/codex-protocol/v2/ThreadMetadataUpdateParams.js +0 -1
  702. package/bundle/dist/codex-protocol/v2/ThreadMetadataUpdateResponse.js +0 -1
  703. package/bundle/dist/codex-protocol/v2/ThreadNameUpdatedNotification.js +0 -1
  704. package/bundle/dist/codex-protocol/v2/ThreadReadParams.js +0 -1
  705. package/bundle/dist/codex-protocol/v2/ThreadReadResponse.js +0 -1
  706. package/bundle/dist/codex-protocol/v2/ThreadRealtimeAudioChunk.js +0 -1
  707. package/bundle/dist/codex-protocol/v2/ThreadRealtimeClosedNotification.js +0 -1
  708. package/bundle/dist/codex-protocol/v2/ThreadRealtimeErrorNotification.js +0 -1
  709. package/bundle/dist/codex-protocol/v2/ThreadRealtimeItemAddedNotification.js +0 -1
  710. package/bundle/dist/codex-protocol/v2/ThreadRealtimeOutputAudioDeltaNotification.js +0 -1
  711. package/bundle/dist/codex-protocol/v2/ThreadRealtimeSdpNotification.js +0 -1
  712. package/bundle/dist/codex-protocol/v2/ThreadRealtimeStartTransport.js +0 -1
  713. package/bundle/dist/codex-protocol/v2/ThreadRealtimeStartedNotification.js +0 -1
  714. package/bundle/dist/codex-protocol/v2/ThreadRealtimeTranscriptDeltaNotification.js +0 -1
  715. package/bundle/dist/codex-protocol/v2/ThreadRealtimeTranscriptDoneNotification.js +0 -1
  716. package/bundle/dist/codex-protocol/v2/ThreadResumeParams.js +0 -1
  717. package/bundle/dist/codex-protocol/v2/ThreadResumeResponse.js +0 -1
  718. package/bundle/dist/codex-protocol/v2/ThreadRollbackParams.js +0 -1
  719. package/bundle/dist/codex-protocol/v2/ThreadRollbackResponse.js +0 -1
  720. package/bundle/dist/codex-protocol/v2/ThreadSetNameParams.js +0 -1
  721. package/bundle/dist/codex-protocol/v2/ThreadSetNameResponse.js +0 -1
  722. package/bundle/dist/codex-protocol/v2/ThreadShellCommandParams.js +0 -1
  723. package/bundle/dist/codex-protocol/v2/ThreadShellCommandResponse.js +0 -1
  724. package/bundle/dist/codex-protocol/v2/ThreadSortKey.js +0 -1
  725. package/bundle/dist/codex-protocol/v2/ThreadSource.js +0 -1
  726. package/bundle/dist/codex-protocol/v2/ThreadSourceKind.js +0 -1
  727. package/bundle/dist/codex-protocol/v2/ThreadStartParams.js +0 -1
  728. package/bundle/dist/codex-protocol/v2/ThreadStartResponse.js +0 -1
  729. package/bundle/dist/codex-protocol/v2/ThreadStartSource.js +0 -1
  730. package/bundle/dist/codex-protocol/v2/ThreadStartedNotification.js +0 -1
  731. package/bundle/dist/codex-protocol/v2/ThreadStatus.js +0 -1
  732. package/bundle/dist/codex-protocol/v2/ThreadStatusChangedNotification.js +0 -1
  733. package/bundle/dist/codex-protocol/v2/ThreadTokenUsage.js +0 -1
  734. package/bundle/dist/codex-protocol/v2/ThreadTokenUsageUpdatedNotification.js +0 -1
  735. package/bundle/dist/codex-protocol/v2/ThreadUnarchiveParams.js +0 -1
  736. package/bundle/dist/codex-protocol/v2/ThreadUnarchiveResponse.js +0 -1
  737. package/bundle/dist/codex-protocol/v2/ThreadUnarchivedNotification.js +0 -1
  738. package/bundle/dist/codex-protocol/v2/ThreadUnsubscribeParams.js +0 -1
  739. package/bundle/dist/codex-protocol/v2/ThreadUnsubscribeResponse.js +0 -1
  740. package/bundle/dist/codex-protocol/v2/ThreadUnsubscribeStatus.js +0 -1
  741. package/bundle/dist/codex-protocol/v2/TokenUsageBreakdown.js +0 -1
  742. package/bundle/dist/codex-protocol/v2/ToolRequestUserInputAnswer.js +0 -1
  743. package/bundle/dist/codex-protocol/v2/ToolRequestUserInputOption.js +0 -1
  744. package/bundle/dist/codex-protocol/v2/ToolRequestUserInputParams.js +0 -1
  745. package/bundle/dist/codex-protocol/v2/ToolRequestUserInputQuestion.js +0 -1
  746. package/bundle/dist/codex-protocol/v2/ToolRequestUserInputResponse.js +0 -1
  747. package/bundle/dist/codex-protocol/v2/ToolsV2.js +0 -1
  748. package/bundle/dist/codex-protocol/v2/Turn.js +0 -1
  749. package/bundle/dist/codex-protocol/v2/TurnCompletedNotification.js +0 -1
  750. package/bundle/dist/codex-protocol/v2/TurnDiffUpdatedNotification.js +0 -1
  751. package/bundle/dist/codex-protocol/v2/TurnEnvironmentParams.js +0 -1
  752. package/bundle/dist/codex-protocol/v2/TurnError.js +0 -1
  753. package/bundle/dist/codex-protocol/v2/TurnInterruptParams.js +0 -1
  754. package/bundle/dist/codex-protocol/v2/TurnInterruptResponse.js +0 -1
  755. package/bundle/dist/codex-protocol/v2/TurnItemsView.js +0 -1
  756. package/bundle/dist/codex-protocol/v2/TurnPlanStep.js +0 -1
  757. package/bundle/dist/codex-protocol/v2/TurnPlanStepStatus.js +0 -1
  758. package/bundle/dist/codex-protocol/v2/TurnPlanUpdatedNotification.js +0 -1
  759. package/bundle/dist/codex-protocol/v2/TurnStartParams.js +0 -1
  760. package/bundle/dist/codex-protocol/v2/TurnStartResponse.js +0 -1
  761. package/bundle/dist/codex-protocol/v2/TurnStartedNotification.js +0 -1
  762. package/bundle/dist/codex-protocol/v2/TurnStatus.js +0 -1
  763. package/bundle/dist/codex-protocol/v2/TurnSteerParams.js +0 -1
  764. package/bundle/dist/codex-protocol/v2/TurnSteerResponse.js +0 -1
  765. package/bundle/dist/codex-protocol/v2/UserInput.js +0 -1
  766. package/bundle/dist/codex-protocol/v2/WarningNotification.js +0 -1
  767. package/bundle/dist/codex-protocol/v2/WebSearchAction.js +0 -1
  768. package/bundle/dist/codex-protocol/v2/WindowsSandboxReadiness.js +0 -1
  769. package/bundle/dist/codex-protocol/v2/WindowsSandboxReadinessResponse.js +0 -1
  770. package/bundle/dist/codex-protocol/v2/WindowsSandboxSetupCompletedNotification.js +0 -1
  771. package/bundle/dist/codex-protocol/v2/WindowsSandboxSetupMode.js +0 -1
  772. package/bundle/dist/codex-protocol/v2/WindowsSandboxSetupStartParams.js +0 -1
  773. package/bundle/dist/codex-protocol/v2/WindowsSandboxSetupStartResponse.js +0 -1
  774. package/bundle/dist/codex-protocol/v2/WindowsWorldWritableWarningNotification.js +0 -1
  775. package/bundle/dist/codex-protocol/v2/WriteStatus.js +0 -1
  776. package/bundle/dist/codex-protocol/v2/index.js +0 -7
  777. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +0 -9
  778. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/benchmark.CX_oY03V.js +0 -41
  779. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/evaluatedModules.Dg1zASAC.js +0 -19
  780. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/index.Chj8NDwU.js +0 -202
  781. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/index.DdgEv5B1.js +0 -46
  782. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js +0 -119
  783. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/test.DNmyFkvJ.js +0 -3044
  784. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js +0 -59
  785. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_ms_f9cfcfeddd63e656d4010c98521af26c/node_modules/vitest/dist/index.js +0 -28
  786. package/bundle/dist/utils/providers/openai/codex-rpc.js +0 -153
  787. package/bundle/dist/utils/providers/openai/codex-worker.js +0 -642
  788. package/bundle/dist/utils/providers/openai/openai-worker-pool-config.js +0 -51
  789. package/bundle/src/codex-protocol/AbsolutePathBuf.ts +0 -14
  790. package/bundle/src/codex-protocol/AgentPath.ts +0 -5
  791. package/bundle/src/codex-protocol/ApplyPatchApprovalParams.ts +0 -24
  792. package/bundle/src/codex-protocol/ApplyPatchApprovalResponse.ts +0 -6
  793. package/bundle/src/codex-protocol/AuthMode.ts +0 -8
  794. package/bundle/src/codex-protocol/ClientInfo.ts +0 -5
  795. package/bundle/src/codex-protocol/ClientNotification.ts +0 -5
  796. package/bundle/src/codex-protocol/ClientRequest.ts +0 -176
  797. package/bundle/src/codex-protocol/CollaborationMode.ts +0 -10
  798. package/bundle/src/codex-protocol/ContentItem.ts +0 -9
  799. package/bundle/src/codex-protocol/ConversationGitInfo.ts +0 -9
  800. package/bundle/src/codex-protocol/ConversationSummary.ts +0 -19
  801. package/bundle/src/codex-protocol/ExecCommandApprovalParams.ts +0 -22
  802. package/bundle/src/codex-protocol/ExecCommandApprovalResponse.ts +0 -6
  803. package/bundle/src/codex-protocol/ExecPolicyAmendment.ts +0 -12
  804. package/bundle/src/codex-protocol/FileChange.ts +0 -8
  805. package/bundle/src/codex-protocol/ForcedLoginMethod.ts +0 -5
  806. package/bundle/src/codex-protocol/FunctionCallOutputBody.ts +0 -6
  807. package/bundle/src/codex-protocol/FunctionCallOutputContentItem.ts +0 -12
  808. package/bundle/src/codex-protocol/FuzzyFileSearchMatchType.ts +0 -5
  809. package/bundle/src/codex-protocol/FuzzyFileSearchParams.ts +0 -9
  810. package/bundle/src/codex-protocol/FuzzyFileSearchResponse.ts +0 -6
  811. package/bundle/src/codex-protocol/FuzzyFileSearchResult.ts +0 -16
  812. package/bundle/src/codex-protocol/FuzzyFileSearchSessionCompletedNotification.ts +0 -5
  813. package/bundle/src/codex-protocol/FuzzyFileSearchSessionUpdatedNotification.ts +0 -10
  814. package/bundle/src/codex-protocol/GetAuthStatusParams.ts +0 -5
  815. package/bundle/src/codex-protocol/GetAuthStatusResponse.ts +0 -10
  816. package/bundle/src/codex-protocol/GetConversationSummaryParams.ts +0 -6
  817. package/bundle/src/codex-protocol/GetConversationSummaryResponse.ts +0 -6
  818. package/bundle/src/codex-protocol/GitDiffToRemoteParams.ts +0 -5
  819. package/bundle/src/codex-protocol/GitDiffToRemoteResponse.ts +0 -6
  820. package/bundle/src/codex-protocol/GitSha.ts +0 -5
  821. package/bundle/src/codex-protocol/ImageDetail.ts +0 -5
  822. package/bundle/src/codex-protocol/InitializeCapabilities.ts +0 -18
  823. package/bundle/src/codex-protocol/InitializeParams.ts +0 -10
  824. package/bundle/src/codex-protocol/InitializeResponse.ts +0 -22
  825. package/bundle/src/codex-protocol/InputModality.ts +0 -8
  826. package/bundle/src/codex-protocol/InternalSessionSource.ts +0 -5
  827. package/bundle/src/codex-protocol/LocalShellAction.ts +0 -6
  828. package/bundle/src/codex-protocol/LocalShellExecAction.ts +0 -11
  829. package/bundle/src/codex-protocol/LocalShellStatus.ts +0 -5
  830. package/bundle/src/codex-protocol/MessagePhase.ts +0 -11
  831. package/bundle/src/codex-protocol/ModeKind.ts +0 -8
  832. package/bundle/src/codex-protocol/NetworkPolicyAmendment.ts +0 -6
  833. package/bundle/src/codex-protocol/NetworkPolicyRuleAction.ts +0 -5
  834. package/bundle/src/codex-protocol/ParsedCommand.ts +0 -20
  835. package/bundle/src/codex-protocol/Personality.ts +0 -5
  836. package/bundle/src/codex-protocol/PlanType.ts +0 -17
  837. package/bundle/src/codex-protocol/RealtimeConversationVersion.ts +0 -5
  838. package/bundle/src/codex-protocol/RealtimeOutputModality.ts +0 -5
  839. package/bundle/src/codex-protocol/RealtimeVoice.ts +0 -24
  840. package/bundle/src/codex-protocol/RealtimeVoicesList.ts +0 -11
  841. package/bundle/src/codex-protocol/ReasoningEffort.ts +0 -8
  842. package/bundle/src/codex-protocol/ReasoningItemContent.ts +0 -7
  843. package/bundle/src/codex-protocol/ReasoningItemReasoningSummary.ts +0 -5
  844. package/bundle/src/codex-protocol/ReasoningSummary.ts +0 -10
  845. package/bundle/src/codex-protocol/RequestId.ts +0 -5
  846. package/bundle/src/codex-protocol/Resource.ts +0 -19
  847. package/bundle/src/codex-protocol/ResourceContent.ts +0 -27
  848. package/bundle/src/codex-protocol/ResourceTemplate.ts +0 -16
  849. package/bundle/src/codex-protocol/ResponseItem.ts +0 -63
  850. package/bundle/src/codex-protocol/ReviewDecision.ts +0 -17
  851. package/bundle/src/codex-protocol/ServerNotification.ts +0 -154
  852. package/bundle/src/codex-protocol/ServerRequest.ts +0 -47
  853. package/bundle/src/codex-protocol/SessionSource.ts +0 -15
  854. package/bundle/src/codex-protocol/Settings.ts +0 -13
  855. package/bundle/src/codex-protocol/SubAgentSource.ts +0 -20
  856. package/bundle/src/codex-protocol/ThreadId.ts +0 -5
  857. package/bundle/src/codex-protocol/ThreadMemoryMode.ts +0 -5
  858. package/bundle/src/codex-protocol/Tool.ts +0 -18
  859. package/bundle/src/codex-protocol/Verbosity.ts +0 -9
  860. package/bundle/src/codex-protocol/WebSearchAction.ts +0 -9
  861. package/bundle/src/codex-protocol/WebSearchContextSize.ts +0 -5
  862. package/bundle/src/codex-protocol/WebSearchLocation.ts +0 -10
  863. package/bundle/src/codex-protocol/WebSearchMode.ts +0 -5
  864. package/bundle/src/codex-protocol/WebSearchToolConfig.ts +0 -11
  865. package/bundle/src/codex-protocol/index.ts +0 -79
  866. package/bundle/src/codex-protocol/serde_json/JsonValue.ts +0 -11
  867. package/bundle/src/codex-protocol/v2/Account.ts +0 -9
  868. package/bundle/src/codex-protocol/v2/AccountLoginCompletedNotification.ts +0 -9
  869. package/bundle/src/codex-protocol/v2/AccountRateLimitsUpdatedNotification.ts +0 -6
  870. package/bundle/src/codex-protocol/v2/AccountUpdatedNotification.ts +0 -7
  871. package/bundle/src/codex-protocol/v2/ActivePermissionProfile.ts +0 -22
  872. package/bundle/src/codex-protocol/v2/ActivePermissionProfileModification.ts +0 -9
  873. package/bundle/src/codex-protocol/v2/AddCreditsNudgeCreditType.ts +0 -5
  874. package/bundle/src/codex-protocol/v2/AddCreditsNudgeEmailStatus.ts +0 -5
  875. package/bundle/src/codex-protocol/v2/AdditionalFileSystemPermissions.ts +0 -18
  876. package/bundle/src/codex-protocol/v2/AdditionalNetworkPermissions.ts +0 -5
  877. package/bundle/src/codex-protocol/v2/AdditionalPermissionProfile.ts +0 -13
  878. package/bundle/src/codex-protocol/v2/AgentMessageDeltaNotification.ts +0 -10
  879. package/bundle/src/codex-protocol/v2/AnalyticsConfig.ts +0 -14
  880. package/bundle/src/codex-protocol/v2/AppBranding.ts +0 -15
  881. package/bundle/src/codex-protocol/v2/AppInfo.ts +0 -32
  882. package/bundle/src/codex-protocol/v2/AppListUpdatedNotification.ts +0 -9
  883. package/bundle/src/codex-protocol/v2/AppMetadata.ts +0 -20
  884. package/bundle/src/codex-protocol/v2/AppReview.ts +0 -5
  885. package/bundle/src/codex-protocol/v2/AppScreenshot.ts +0 -5
  886. package/bundle/src/codex-protocol/v2/AppSummary.ts +0 -14
  887. package/bundle/src/codex-protocol/v2/AppToolApproval.ts +0 -5
  888. package/bundle/src/codex-protocol/v2/AppToolsConfig.ts +0 -8
  889. package/bundle/src/codex-protocol/v2/ApprovalsReviewer.ts +0 -12
  890. package/bundle/src/codex-protocol/v2/AppsConfig.ts +0 -17
  891. package/bundle/src/codex-protocol/v2/AppsDefaultConfig.ts +0 -9
  892. package/bundle/src/codex-protocol/v2/AppsListParams.ts +0 -25
  893. package/bundle/src/codex-protocol/v2/AppsListResponse.ts +0 -16
  894. package/bundle/src/codex-protocol/v2/AskForApproval.ts +0 -18
  895. package/bundle/src/codex-protocol/v2/AutoReviewDecisionSource.ts +0 -8
  896. package/bundle/src/codex-protocol/v2/ByteRange.ts +0 -5
  897. package/bundle/src/codex-protocol/v2/CancelLoginAccountParams.ts +0 -5
  898. package/bundle/src/codex-protocol/v2/CancelLoginAccountResponse.ts +0 -6
  899. package/bundle/src/codex-protocol/v2/CancelLoginAccountStatus.ts +0 -5
  900. package/bundle/src/codex-protocol/v2/ChatgptAuthTokensRefreshParams.ts +0 -18
  901. package/bundle/src/codex-protocol/v2/ChatgptAuthTokensRefreshReason.ts +0 -5
  902. package/bundle/src/codex-protocol/v2/ChatgptAuthTokensRefreshResponse.ts +0 -9
  903. package/bundle/src/codex-protocol/v2/CodexErrorInfo.ts +0 -27
  904. package/bundle/src/codex-protocol/v2/CollabAgentState.ts +0 -6
  905. package/bundle/src/codex-protocol/v2/CollabAgentStatus.ts +0 -12
  906. package/bundle/src/codex-protocol/v2/CollabAgentTool.ts +0 -5
  907. package/bundle/src/codex-protocol/v2/CollabAgentToolCallStatus.ts +0 -5
  908. package/bundle/src/codex-protocol/v2/CollaborationModeMask.ts +0 -15
  909. package/bundle/src/codex-protocol/v2/CommandAction.ts +0 -10
  910. package/bundle/src/codex-protocol/v2/CommandExecOutputDeltaNotification.ts +0 -31
  911. package/bundle/src/codex-protocol/v2/CommandExecOutputStream.ts +0 -8
  912. package/bundle/src/codex-protocol/v2/CommandExecParams.ts +0 -87
  913. package/bundle/src/codex-protocol/v2/CommandExecResizeParams.ts +0 -19
  914. package/bundle/src/codex-protocol/v2/CommandExecResizeResponse.ts +0 -8
  915. package/bundle/src/codex-protocol/v2/CommandExecResponse.ts +0 -25
  916. package/bundle/src/codex-protocol/v2/CommandExecTerminalSize.ts +0 -17
  917. package/bundle/src/codex-protocol/v2/CommandExecTerminateParams.ts +0 -14
  918. package/bundle/src/codex-protocol/v2/CommandExecTerminateResponse.ts +0 -8
  919. package/bundle/src/codex-protocol/v2/CommandExecWriteParams.ts +0 -23
  920. package/bundle/src/codex-protocol/v2/CommandExecWriteResponse.ts +0 -8
  921. package/bundle/src/codex-protocol/v2/CommandExecutionApprovalDecision.ts +0 -13
  922. package/bundle/src/codex-protocol/v2/CommandExecutionOutputDeltaNotification.ts +0 -10
  923. package/bundle/src/codex-protocol/v2/CommandExecutionRequestApprovalParams.ts +0 -47
  924. package/bundle/src/codex-protocol/v2/CommandExecutionRequestApprovalResponse.ts +0 -8
  925. package/bundle/src/codex-protocol/v2/CommandExecutionSource.ts +0 -9
  926. package/bundle/src/codex-protocol/v2/CommandExecutionStatus.ts +0 -5
  927. package/bundle/src/codex-protocol/v2/CommandMigration.ts +0 -5
  928. package/bundle/src/codex-protocol/v2/Config.ts +0 -53
  929. package/bundle/src/codex-protocol/v2/ConfigBatchWriteParams.ts +0 -17
  930. package/bundle/src/codex-protocol/v2/ConfigEdit.ts +0 -7
  931. package/bundle/src/codex-protocol/v2/ConfigLayer.ts +0 -12
  932. package/bundle/src/codex-protocol/v2/ConfigLayerMetadata.ts +0 -6
  933. package/bundle/src/codex-protocol/v2/ConfigLayerSource.ts +0 -27
  934. package/bundle/src/codex-protocol/v2/ConfigReadParams.ts +0 -13
  935. package/bundle/src/codex-protocol/v2/ConfigReadResponse.ts +0 -12
  936. package/bundle/src/codex-protocol/v2/ConfigRequirements.ts +0 -15
  937. package/bundle/src/codex-protocol/v2/ConfigRequirementsReadResponse.ts +0 -11
  938. package/bundle/src/codex-protocol/v2/ConfigValueWriteParams.ts +0 -16
  939. package/bundle/src/codex-protocol/v2/ConfigWarningNotification.ts +0 -23
  940. package/bundle/src/codex-protocol/v2/ConfigWriteResponse.ts +0 -16
  941. package/bundle/src/codex-protocol/v2/ConfiguredHookHandler.ts +0 -14
  942. package/bundle/src/codex-protocol/v2/ConfiguredHookMatcherGroup.ts +0 -9
  943. package/bundle/src/codex-protocol/v2/ContextCompactedNotification.ts +0 -8
  944. package/bundle/src/codex-protocol/v2/CreditsSnapshot.ts +0 -5
  945. package/bundle/src/codex-protocol/v2/DeprecationNoticeNotification.ts +0 -14
  946. package/bundle/src/codex-protocol/v2/DynamicToolCallOutputContentItem.ts +0 -7
  947. package/bundle/src/codex-protocol/v2/DynamicToolCallParams.ts +0 -13
  948. package/bundle/src/codex-protocol/v2/DynamicToolCallResponse.ts +0 -9
  949. package/bundle/src/codex-protocol/v2/DynamicToolCallStatus.ts +0 -5
  950. package/bundle/src/codex-protocol/v2/DynamicToolSpec.ts +0 -12
  951. package/bundle/src/codex-protocol/v2/ErrorNotification.ts +0 -11
  952. package/bundle/src/codex-protocol/v2/ExecPolicyAmendment.ts +0 -5
  953. package/bundle/src/codex-protocol/v2/ExperimentalFeature.ts +0 -38
  954. package/bundle/src/codex-protocol/v2/ExperimentalFeatureEnablementSetParams.ts +0 -13
  955. package/bundle/src/codex-protocol/v2/ExperimentalFeatureEnablementSetResponse.ts +0 -10
  956. package/bundle/src/codex-protocol/v2/ExperimentalFeatureListParams.ts +0 -14
  957. package/bundle/src/codex-protocol/v2/ExperimentalFeatureListResponse.ts +0 -13
  958. package/bundle/src/codex-protocol/v2/ExperimentalFeatureStage.ts +0 -10
  959. package/bundle/src/codex-protocol/v2/ExternalAgentConfigDetectParams.ts +0 -14
  960. package/bundle/src/codex-protocol/v2/ExternalAgentConfigDetectResponse.ts +0 -6
  961. package/bundle/src/codex-protocol/v2/ExternalAgentConfigImportCompletedNotification.ts +0 -5
  962. package/bundle/src/codex-protocol/v2/ExternalAgentConfigImportParams.ts +0 -8
  963. package/bundle/src/codex-protocol/v2/ExternalAgentConfigImportResponse.ts +0 -5
  964. package/bundle/src/codex-protocol/v2/ExternalAgentConfigMigrationItem.ts +0 -15
  965. package/bundle/src/codex-protocol/v2/ExternalAgentConfigMigrationItemType.ts +0 -14
  966. package/bundle/src/codex-protocol/v2/FeedbackUploadParams.ts +0 -12
  967. package/bundle/src/codex-protocol/v2/FeedbackUploadResponse.ts +0 -5
  968. package/bundle/src/codex-protocol/v2/FileChangeApprovalDecision.ts +0 -5
  969. package/bundle/src/codex-protocol/v2/FileChangeOutputDeltaNotification.ts +0 -15
  970. package/bundle/src/codex-protocol/v2/FileChangePatchUpdatedNotification.ts +0 -11
  971. package/bundle/src/codex-protocol/v2/FileChangeRequestApprovalParams.ts +0 -22
  972. package/bundle/src/codex-protocol/v2/FileChangeRequestApprovalResponse.ts +0 -6
  973. package/bundle/src/codex-protocol/v2/FileSystemAccessMode.ts +0 -5
  974. package/bundle/src/codex-protocol/v2/FileSystemPath.ts +0 -10
  975. package/bundle/src/codex-protocol/v2/FileSystemSandboxEntry.ts +0 -7
  976. package/bundle/src/codex-protocol/v2/FileSystemSpecialPath.ts +0 -11
  977. package/bundle/src/codex-protocol/v2/FileUpdateChange.ts +0 -6
  978. package/bundle/src/codex-protocol/v2/FsChangedNotification.ts +0 -18
  979. package/bundle/src/codex-protocol/v2/FsCopyParams.ts +0 -22
  980. package/bundle/src/codex-protocol/v2/FsCopyResponse.ts +0 -8
  981. package/bundle/src/codex-protocol/v2/FsCreateDirectoryParams.ts +0 -18
  982. package/bundle/src/codex-protocol/v2/FsCreateDirectoryResponse.ts +0 -8
  983. package/bundle/src/codex-protocol/v2/FsGetMetadataParams.ts +0 -14
  984. package/bundle/src/codex-protocol/v2/FsGetMetadataResponse.ts +0 -29
  985. package/bundle/src/codex-protocol/v2/FsReadDirectoryEntry.ts +0 -21
  986. package/bundle/src/codex-protocol/v2/FsReadDirectoryParams.ts +0 -14
  987. package/bundle/src/codex-protocol/v2/FsReadDirectoryResponse.ts +0 -14
  988. package/bundle/src/codex-protocol/v2/FsReadFileParams.ts +0 -14
  989. package/bundle/src/codex-protocol/v2/FsReadFileResponse.ts +0 -13
  990. package/bundle/src/codex-protocol/v2/FsRemoveParams.ts +0 -22
  991. package/bundle/src/codex-protocol/v2/FsRemoveResponse.ts +0 -8
  992. package/bundle/src/codex-protocol/v2/FsUnwatchParams.ts +0 -13
  993. package/bundle/src/codex-protocol/v2/FsUnwatchResponse.ts +0 -8
  994. package/bundle/src/codex-protocol/v2/FsWatchParams.ts +0 -18
  995. package/bundle/src/codex-protocol/v2/FsWatchResponse.ts +0 -14
  996. package/bundle/src/codex-protocol/v2/FsWriteFileParams.ts +0 -18
  997. package/bundle/src/codex-protocol/v2/FsWriteFileResponse.ts +0 -8
  998. package/bundle/src/codex-protocol/v2/GetAccountParams.ts +0 -14
  999. package/bundle/src/codex-protocol/v2/GetAccountRateLimitsResponse.ts +0 -15
  1000. package/bundle/src/codex-protocol/v2/GetAccountResponse.ts +0 -6
  1001. package/bundle/src/codex-protocol/v2/GitInfo.ts +0 -5
  1002. package/bundle/src/codex-protocol/v2/GrantedPermissionProfile.ts +0 -10
  1003. package/bundle/src/codex-protocol/v2/GuardianApprovalReview.ts +0 -18
  1004. package/bundle/src/codex-protocol/v2/GuardianApprovalReviewAction.ts +0 -34
  1005. package/bundle/src/codex-protocol/v2/GuardianApprovalReviewStatus.ts +0 -13
  1006. package/bundle/src/codex-protocol/v2/GuardianCommandSource.ts +0 -5
  1007. package/bundle/src/codex-protocol/v2/GuardianRiskLevel.ts +0 -8
  1008. package/bundle/src/codex-protocol/v2/GuardianUserAuthorization.ts +0 -8
  1009. package/bundle/src/codex-protocol/v2/GuardianWarningNotification.ts +0 -14
  1010. package/bundle/src/codex-protocol/v2/HookCompletedNotification.ts +0 -10
  1011. package/bundle/src/codex-protocol/v2/HookErrorInfo.ts +0 -5
  1012. package/bundle/src/codex-protocol/v2/HookEventName.ts +0 -13
  1013. package/bundle/src/codex-protocol/v2/HookExecutionMode.ts +0 -5
  1014. package/bundle/src/codex-protocol/v2/HookHandlerType.ts +0 -5
  1015. package/bundle/src/codex-protocol/v2/HookMetadata.ts +0 -26
  1016. package/bundle/src/codex-protocol/v2/HookMigration.ts +0 -5
  1017. package/bundle/src/codex-protocol/v2/HookOutputEntry.ts +0 -6
  1018. package/bundle/src/codex-protocol/v2/HookOutputEntryKind.ts +0 -5
  1019. package/bundle/src/codex-protocol/v2/HookPromptFragment.ts +0 -5
  1020. package/bundle/src/codex-protocol/v2/HookRunStatus.ts +0 -5
  1021. package/bundle/src/codex-protocol/v2/HookRunSummary.ts +0 -28
  1022. package/bundle/src/codex-protocol/v2/HookScope.ts +0 -5
  1023. package/bundle/src/codex-protocol/v2/HookSource.ts +0 -15
  1024. package/bundle/src/codex-protocol/v2/HookStartedNotification.ts +0 -10
  1025. package/bundle/src/codex-protocol/v2/HookTrustStatus.ts +0 -5
  1026. package/bundle/src/codex-protocol/v2/HooksListEntry.ts +0 -12
  1027. package/bundle/src/codex-protocol/v2/HooksListParams.ts +0 -10
  1028. package/bundle/src/codex-protocol/v2/HooksListResponse.ts +0 -6
  1029. package/bundle/src/codex-protocol/v2/ItemCompletedNotification.ts +0 -14
  1030. package/bundle/src/codex-protocol/v2/ItemGuardianApprovalReviewCompletedNotification.ts +0 -44
  1031. package/bundle/src/codex-protocol/v2/ItemGuardianApprovalReviewStartedNotification.ts +0 -38
  1032. package/bundle/src/codex-protocol/v2/ItemStartedNotification.ts +0 -14
  1033. package/bundle/src/codex-protocol/v2/ListMcpServerStatusParams.ts +0 -20
  1034. package/bundle/src/codex-protocol/v2/ListMcpServerStatusResponse.ts +0 -13
  1035. package/bundle/src/codex-protocol/v2/LoginAccountParams.ts +0 -27
  1036. package/bundle/src/codex-protocol/v2/LoginAccountResponse.ts +0 -27
  1037. package/bundle/src/codex-protocol/v2/LogoutAccountResponse.ts +0 -5
  1038. package/bundle/src/codex-protocol/v2/ManagedHooksRequirements.ts +0 -17
  1039. package/bundle/src/codex-protocol/v2/MarketplaceAddParams.ts +0 -9
  1040. package/bundle/src/codex-protocol/v2/MarketplaceAddResponse.ts +0 -10
  1041. package/bundle/src/codex-protocol/v2/MarketplaceInterface.ts +0 -5
  1042. package/bundle/src/codex-protocol/v2/MarketplaceLoadErrorInfo.ts +0 -6
  1043. package/bundle/src/codex-protocol/v2/MarketplaceRemoveParams.ts +0 -5
  1044. package/bundle/src/codex-protocol/v2/MarketplaceRemoveResponse.ts +0 -9
  1045. package/bundle/src/codex-protocol/v2/MarketplaceUpgradeErrorInfo.ts +0 -5
  1046. package/bundle/src/codex-protocol/v2/MarketplaceUpgradeParams.ts +0 -5
  1047. package/bundle/src/codex-protocol/v2/MarketplaceUpgradeResponse.ts +0 -11
  1048. package/bundle/src/codex-protocol/v2/McpAuthStatus.ts +0 -5
  1049. package/bundle/src/codex-protocol/v2/McpElicitationArrayType.ts +0 -5
  1050. package/bundle/src/codex-protocol/v2/McpElicitationBooleanSchema.ts +0 -11
  1051. package/bundle/src/codex-protocol/v2/McpElicitationBooleanType.ts +0 -5
  1052. package/bundle/src/codex-protocol/v2/McpElicitationConstOption.ts +0 -5
  1053. package/bundle/src/codex-protocol/v2/McpElicitationEnumSchema.ts +0 -11
  1054. package/bundle/src/codex-protocol/v2/McpElicitationLegacyTitledEnumSchema.ts +0 -13
  1055. package/bundle/src/codex-protocol/v2/McpElicitationMultiSelectEnumSchema.ts +0 -9
  1056. package/bundle/src/codex-protocol/v2/McpElicitationNumberSchema.ts +0 -13
  1057. package/bundle/src/codex-protocol/v2/McpElicitationNumberType.ts +0 -5
  1058. package/bundle/src/codex-protocol/v2/McpElicitationObjectType.ts +0 -5
  1059. package/bundle/src/codex-protocol/v2/McpElicitationPrimitiveSchema.ts +0 -13
  1060. package/bundle/src/codex-protocol/v2/McpElicitationSchema.ts +0 -18
  1061. package/bundle/src/codex-protocol/v2/McpElicitationSingleSelectEnumSchema.ts +0 -9
  1062. package/bundle/src/codex-protocol/v2/McpElicitationStringFormat.ts +0 -5
  1063. package/bundle/src/codex-protocol/v2/McpElicitationStringSchema.ts +0 -15
  1064. package/bundle/src/codex-protocol/v2/McpElicitationStringType.ts +0 -5
  1065. package/bundle/src/codex-protocol/v2/McpElicitationTitledEnumItems.ts +0 -6
  1066. package/bundle/src/codex-protocol/v2/McpElicitationTitledMultiSelectEnumSchema.ts +0 -15
  1067. package/bundle/src/codex-protocol/v2/McpElicitationTitledSingleSelectEnumSchema.ts +0 -13
  1068. package/bundle/src/codex-protocol/v2/McpElicitationUntitledEnumItems.ts +0 -9
  1069. package/bundle/src/codex-protocol/v2/McpElicitationUntitledMultiSelectEnumSchema.ts +0 -15
  1070. package/bundle/src/codex-protocol/v2/McpElicitationUntitledSingleSelectEnumSchema.ts +0 -12
  1071. package/bundle/src/codex-protocol/v2/McpResourceReadParams.ts +0 -5
  1072. package/bundle/src/codex-protocol/v2/McpResourceReadResponse.ts +0 -6
  1073. package/bundle/src/codex-protocol/v2/McpServerElicitationAction.ts +0 -5
  1074. package/bundle/src/codex-protocol/v2/McpServerElicitationRequestParams.ts +0 -27
  1075. package/bundle/src/codex-protocol/v2/McpServerElicitationRequestResponse.ts +0 -19
  1076. package/bundle/src/codex-protocol/v2/McpServerMigration.ts +0 -5
  1077. package/bundle/src/codex-protocol/v2/McpServerOauthLoginCompletedNotification.ts +0 -9
  1078. package/bundle/src/codex-protocol/v2/McpServerOauthLoginParams.ts +0 -9
  1079. package/bundle/src/codex-protocol/v2/McpServerOauthLoginResponse.ts +0 -5
  1080. package/bundle/src/codex-protocol/v2/McpServerRefreshResponse.ts +0 -5
  1081. package/bundle/src/codex-protocol/v2/McpServerStartupState.ts +0 -5
  1082. package/bundle/src/codex-protocol/v2/McpServerStatus.ts +0 -15
  1083. package/bundle/src/codex-protocol/v2/McpServerStatusDetail.ts +0 -5
  1084. package/bundle/src/codex-protocol/v2/McpServerStatusUpdatedNotification.ts +0 -10
  1085. package/bundle/src/codex-protocol/v2/McpServerToolCallParams.ts +0 -12
  1086. package/bundle/src/codex-protocol/v2/McpServerToolCallResponse.ts +0 -11
  1087. package/bundle/src/codex-protocol/v2/McpToolCallError.ts +0 -5
  1088. package/bundle/src/codex-protocol/v2/McpToolCallProgressNotification.ts +0 -10
  1089. package/bundle/src/codex-protocol/v2/McpToolCallResult.ts +0 -10
  1090. package/bundle/src/codex-protocol/v2/McpToolCallStatus.ts +0 -5
  1091. package/bundle/src/codex-protocol/v2/MemoryCitation.ts +0 -6
  1092. package/bundle/src/codex-protocol/v2/MemoryCitationEntry.ts +0 -10
  1093. package/bundle/src/codex-protocol/v2/MergeStrategy.ts +0 -5
  1094. package/bundle/src/codex-protocol/v2/MigrationDetails.ts +0 -18
  1095. package/bundle/src/codex-protocol/v2/Model.ts +0 -30
  1096. package/bundle/src/codex-protocol/v2/ModelAvailabilityNux.ts +0 -5
  1097. package/bundle/src/codex-protocol/v2/ModelListParams.ts +0 -18
  1098. package/bundle/src/codex-protocol/v2/ModelListResponse.ts +0 -13
  1099. package/bundle/src/codex-protocol/v2/ModelProviderCapabilitiesReadParams.ts +0 -5
  1100. package/bundle/src/codex-protocol/v2/ModelProviderCapabilitiesReadResponse.ts +0 -9
  1101. package/bundle/src/codex-protocol/v2/ModelRerouteReason.ts +0 -5
  1102. package/bundle/src/codex-protocol/v2/ModelReroutedNotification.ts +0 -12
  1103. package/bundle/src/codex-protocol/v2/ModelServiceTier.ts +0 -5
  1104. package/bundle/src/codex-protocol/v2/ModelUpgradeInfo.ts +0 -10
  1105. package/bundle/src/codex-protocol/v2/ModelVerification.ts +0 -5
  1106. package/bundle/src/codex-protocol/v2/ModelVerificationNotification.ts +0 -10
  1107. package/bundle/src/codex-protocol/v2/NetworkAccess.ts +0 -5
  1108. package/bundle/src/codex-protocol/v2/NetworkApprovalContext.ts +0 -6
  1109. package/bundle/src/codex-protocol/v2/NetworkApprovalProtocol.ts +0 -5
  1110. package/bundle/src/codex-protocol/v2/NetworkDomainPermission.ts +0 -5
  1111. package/bundle/src/codex-protocol/v2/NetworkPolicyAmendment.ts +0 -6
  1112. package/bundle/src/codex-protocol/v2/NetworkPolicyRuleAction.ts +0 -5
  1113. package/bundle/src/codex-protocol/v2/NetworkRequirements.ts +0 -40
  1114. package/bundle/src/codex-protocol/v2/NetworkUnixSocketPermission.ts +0 -5
  1115. package/bundle/src/codex-protocol/v2/NonSteerableTurnKind.ts +0 -5
  1116. package/bundle/src/codex-protocol/v2/OverriddenMetadata.ts +0 -11
  1117. package/bundle/src/codex-protocol/v2/PatchApplyStatus.ts +0 -5
  1118. package/bundle/src/codex-protocol/v2/PatchChangeKind.ts +0 -8
  1119. package/bundle/src/codex-protocol/v2/PermissionGrantScope.ts +0 -5
  1120. package/bundle/src/codex-protocol/v2/PermissionProfile.ts +0 -14
  1121. package/bundle/src/codex-protocol/v2/PermissionProfileFileSystemPermissions.ts +0 -8
  1122. package/bundle/src/codex-protocol/v2/PermissionProfileModificationParams.ts +0 -9
  1123. package/bundle/src/codex-protocol/v2/PermissionProfileNetworkPermissions.ts +0 -5
  1124. package/bundle/src/codex-protocol/v2/PermissionProfileSelectionParams.ts +0 -10
  1125. package/bundle/src/codex-protocol/v2/PermissionsRequestApprovalParams.ts +0 -18
  1126. package/bundle/src/codex-protocol/v2/PermissionsRequestApprovalResponse.ts +0 -14
  1127. package/bundle/src/codex-protocol/v2/PlanDeltaNotification.ts +0 -14
  1128. package/bundle/src/codex-protocol/v2/PluginAuthPolicy.ts +0 -5
  1129. package/bundle/src/codex-protocol/v2/PluginAvailability.ts +0 -5
  1130. package/bundle/src/codex-protocol/v2/PluginDetail.ts +0 -19
  1131. package/bundle/src/codex-protocol/v2/PluginHookSummary.ts +0 -6
  1132. package/bundle/src/codex-protocol/v2/PluginInstallParams.ts +0 -10
  1133. package/bundle/src/codex-protocol/v2/PluginInstallPolicy.ts +0 -5
  1134. package/bundle/src/codex-protocol/v2/PluginInstallResponse.ts +0 -10
  1135. package/bundle/src/codex-protocol/v2/PluginInterface.ts +0 -46
  1136. package/bundle/src/codex-protocol/v2/PluginListMarketplaceKind.ts +0 -5
  1137. package/bundle/src/codex-protocol/v2/PluginListParams.ts +0 -18
  1138. package/bundle/src/codex-protocol/v2/PluginListResponse.ts +0 -11
  1139. package/bundle/src/codex-protocol/v2/PluginMarketplaceEntry.ts +0 -17
  1140. package/bundle/src/codex-protocol/v2/PluginReadParams.ts +0 -10
  1141. package/bundle/src/codex-protocol/v2/PluginReadResponse.ts +0 -6
  1142. package/bundle/src/codex-protocol/v2/PluginShareContext.ts +0 -12
  1143. package/bundle/src/codex-protocol/v2/PluginShareDeleteParams.ts +0 -5
  1144. package/bundle/src/codex-protocol/v2/PluginShareDeleteResponse.ts +0 -5
  1145. package/bundle/src/codex-protocol/v2/PluginShareDiscoverability.ts +0 -5
  1146. package/bundle/src/codex-protocol/v2/PluginShareListItem.ts +0 -11
  1147. package/bundle/src/codex-protocol/v2/PluginShareListParams.ts +0 -5
  1148. package/bundle/src/codex-protocol/v2/PluginShareListResponse.ts +0 -6
  1149. package/bundle/src/codex-protocol/v2/PluginSharePrincipal.ts +0 -10
  1150. package/bundle/src/codex-protocol/v2/PluginSharePrincipalType.ts +0 -5
  1151. package/bundle/src/codex-protocol/v2/PluginShareSaveParams.ts +0 -13
  1152. package/bundle/src/codex-protocol/v2/PluginShareSaveResponse.ts +0 -5
  1153. package/bundle/src/codex-protocol/v2/PluginShareTarget.ts +0 -6
  1154. package/bundle/src/codex-protocol/v2/PluginShareUpdateDiscoverability.ts +0 -5
  1155. package/bundle/src/codex-protocol/v2/PluginShareUpdateTargetsParams.ts +0 -11
  1156. package/bundle/src/codex-protocol/v2/PluginShareUpdateTargetsResponse.ts +0 -10
  1157. package/bundle/src/codex-protocol/v2/PluginSkillReadParams.ts +0 -9
  1158. package/bundle/src/codex-protocol/v2/PluginSkillReadResponse.ts +0 -5
  1159. package/bundle/src/codex-protocol/v2/PluginSource.ts +0 -9
  1160. package/bundle/src/codex-protocol/v2/PluginSummary.ts +0 -29
  1161. package/bundle/src/codex-protocol/v2/PluginUninstallParams.ts +0 -5
  1162. package/bundle/src/codex-protocol/v2/PluginUninstallResponse.ts +0 -5
  1163. package/bundle/src/codex-protocol/v2/PluginsMigration.ts +0 -5
  1164. package/bundle/src/codex-protocol/v2/ProcessExitedNotification.ts +0 -43
  1165. package/bundle/src/codex-protocol/v2/ProcessOutputDeltaNotification.ts +0 -27
  1166. package/bundle/src/codex-protocol/v2/ProcessOutputStream.ts +0 -8
  1167. package/bundle/src/codex-protocol/v2/ProcessTerminalSize.ts +0 -17
  1168. package/bundle/src/codex-protocol/v2/ProfileV2.ts +0 -37
  1169. package/bundle/src/codex-protocol/v2/RateLimitReachedType.ts +0 -10
  1170. package/bundle/src/codex-protocol/v2/RateLimitSnapshot.ts +0 -17
  1171. package/bundle/src/codex-protocol/v2/RateLimitWindow.ts +0 -9
  1172. package/bundle/src/codex-protocol/v2/RawResponseItemCompletedNotification.ts +0 -10
  1173. package/bundle/src/codex-protocol/v2/ReasoningEffortOption.ts +0 -6
  1174. package/bundle/src/codex-protocol/v2/ReasoningSummaryPartAddedNotification.ts +0 -10
  1175. package/bundle/src/codex-protocol/v2/ReasoningSummaryTextDeltaNotification.ts +0 -11
  1176. package/bundle/src/codex-protocol/v2/ReasoningTextDeltaNotification.ts +0 -11
  1177. package/bundle/src/codex-protocol/v2/RemoteControlConnectionStatus.ts +0 -5
  1178. package/bundle/src/codex-protocol/v2/RemoteControlStatusChangedNotification.ts +0 -12
  1179. package/bundle/src/codex-protocol/v2/RequestPermissionProfile.ts +0 -10
  1180. package/bundle/src/codex-protocol/v2/ResidencyRequirement.ts +0 -5
  1181. package/bundle/src/codex-protocol/v2/ReviewDelivery.ts +0 -5
  1182. package/bundle/src/codex-protocol/v2/ReviewStartParams.ts +0 -15
  1183. package/bundle/src/codex-protocol/v2/ReviewStartResponse.ts +0 -15
  1184. package/bundle/src/codex-protocol/v2/ReviewTarget.ts +0 -16
  1185. package/bundle/src/codex-protocol/v2/SandboxMode.ts +0 -5
  1186. package/bundle/src/codex-protocol/v2/SandboxPolicy.ts +0 -17
  1187. package/bundle/src/codex-protocol/v2/SandboxWorkspaceWrite.ts +0 -10
  1188. package/bundle/src/codex-protocol/v2/SendAddCreditsNudgeEmailParams.ts +0 -6
  1189. package/bundle/src/codex-protocol/v2/SendAddCreditsNudgeEmailResponse.ts +0 -6
  1190. package/bundle/src/codex-protocol/v2/ServerRequestResolvedNotification.ts +0 -6
  1191. package/bundle/src/codex-protocol/v2/SessionMigration.ts +0 -5
  1192. package/bundle/src/codex-protocol/v2/SessionSource.ts +0 -13
  1193. package/bundle/src/codex-protocol/v2/SkillDependencies.ts +0 -6
  1194. package/bundle/src/codex-protocol/v2/SkillErrorInfo.ts +0 -5
  1195. package/bundle/src/codex-protocol/v2/SkillInterface.ts +0 -13
  1196. package/bundle/src/codex-protocol/v2/SkillMetadata.ts +0 -21
  1197. package/bundle/src/codex-protocol/v2/SkillScope.ts +0 -5
  1198. package/bundle/src/codex-protocol/v2/SkillSummary.ts +0 -14
  1199. package/bundle/src/codex-protocol/v2/SkillToolDependency.ts +0 -12
  1200. package/bundle/src/codex-protocol/v2/SkillsChangedNotification.ts +0 -11
  1201. package/bundle/src/codex-protocol/v2/SkillsConfigWriteParams.ts +0 -16
  1202. package/bundle/src/codex-protocol/v2/SkillsConfigWriteResponse.ts +0 -5
  1203. package/bundle/src/codex-protocol/v2/SkillsListEntry.ts +0 -11
  1204. package/bundle/src/codex-protocol/v2/SkillsListParams.ts +0 -14
  1205. package/bundle/src/codex-protocol/v2/SkillsListResponse.ts +0 -6
  1206. package/bundle/src/codex-protocol/v2/SortDirection.ts +0 -5
  1207. package/bundle/src/codex-protocol/v2/SubagentMigration.ts +0 -5
  1208. package/bundle/src/codex-protocol/v2/TerminalInteractionNotification.ts +0 -11
  1209. package/bundle/src/codex-protocol/v2/TextElement.ts +0 -15
  1210. package/bundle/src/codex-protocol/v2/TextPosition.ts +0 -14
  1211. package/bundle/src/codex-protocol/v2/TextRange.ts +0 -6
  1212. package/bundle/src/codex-protocol/v2/Thread.ts +0 -88
  1213. package/bundle/src/codex-protocol/v2/ThreadActiveFlag.ts +0 -5
  1214. package/bundle/src/codex-protocol/v2/ThreadApproveGuardianDeniedActionParams.ts +0 -12
  1215. package/bundle/src/codex-protocol/v2/ThreadApproveGuardianDeniedActionResponse.ts +0 -5
  1216. package/bundle/src/codex-protocol/v2/ThreadArchiveParams.ts +0 -5
  1217. package/bundle/src/codex-protocol/v2/ThreadArchiveResponse.ts +0 -5
  1218. package/bundle/src/codex-protocol/v2/ThreadArchivedNotification.ts +0 -5
  1219. package/bundle/src/codex-protocol/v2/ThreadClosedNotification.ts +0 -5
  1220. package/bundle/src/codex-protocol/v2/ThreadCompactStartParams.ts +0 -5
  1221. package/bundle/src/codex-protocol/v2/ThreadCompactStartResponse.ts +0 -5
  1222. package/bundle/src/codex-protocol/v2/ThreadForkParams.ts +0 -40
  1223. package/bundle/src/codex-protocol/v2/ThreadForkResponse.ts +0 -30
  1224. package/bundle/src/codex-protocol/v2/ThreadGoal.ts +0 -15
  1225. package/bundle/src/codex-protocol/v2/ThreadGoalClearedNotification.ts +0 -5
  1226. package/bundle/src/codex-protocol/v2/ThreadGoalStatus.ts +0 -5
  1227. package/bundle/src/codex-protocol/v2/ThreadGoalUpdatedNotification.ts +0 -10
  1228. package/bundle/src/codex-protocol/v2/ThreadInjectItemsParams.ts +0 -12
  1229. package/bundle/src/codex-protocol/v2/ThreadInjectItemsResponse.ts +0 -5
  1230. package/bundle/src/codex-protocol/v2/ThreadItem.ts +0 -156
  1231. package/bundle/src/codex-protocol/v2/ThreadListParams.ts +0 -55
  1232. package/bundle/src/codex-protocol/v2/ThreadListResponse.ts +0 -20
  1233. package/bundle/src/codex-protocol/v2/ThreadLoadedListParams.ts +0 -14
  1234. package/bundle/src/codex-protocol/v2/ThreadLoadedListResponse.ts +0 -15
  1235. package/bundle/src/codex-protocol/v2/ThreadMetadataGitInfoUpdateParams.ts +0 -21
  1236. package/bundle/src/codex-protocol/v2/ThreadMetadataUpdateParams.ts +0 -14
  1237. package/bundle/src/codex-protocol/v2/ThreadMetadataUpdateResponse.ts +0 -6
  1238. package/bundle/src/codex-protocol/v2/ThreadNameUpdatedNotification.ts +0 -5
  1239. package/bundle/src/codex-protocol/v2/ThreadReadParams.ts +0 -11
  1240. package/bundle/src/codex-protocol/v2/ThreadReadResponse.ts +0 -6
  1241. package/bundle/src/codex-protocol/v2/ThreadRealtimeAudioChunk.ts +0 -14
  1242. package/bundle/src/codex-protocol/v2/ThreadRealtimeClosedNotification.ts +0 -8
  1243. package/bundle/src/codex-protocol/v2/ThreadRealtimeErrorNotification.ts +0 -8
  1244. package/bundle/src/codex-protocol/v2/ThreadRealtimeItemAddedNotification.ts +0 -9
  1245. package/bundle/src/codex-protocol/v2/ThreadRealtimeOutputAudioDeltaNotification.ts +0 -12
  1246. package/bundle/src/codex-protocol/v2/ThreadRealtimeSdpNotification.ts +0 -8
  1247. package/bundle/src/codex-protocol/v2/ThreadRealtimeStartTransport.ts +0 -17
  1248. package/bundle/src/codex-protocol/v2/ThreadRealtimeStartedNotification.ts +0 -13
  1249. package/bundle/src/codex-protocol/v2/ThreadRealtimeTranscriptDeltaNotification.ts +0 -16
  1250. package/bundle/src/codex-protocol/v2/ThreadRealtimeTranscriptDoneNotification.ts +0 -16
  1251. package/bundle/src/codex-protocol/v2/ThreadResumeParams.ts +0 -39
  1252. package/bundle/src/codex-protocol/v2/ThreadResumeResponse.ts +0 -30
  1253. package/bundle/src/codex-protocol/v2/ThreadRollbackParams.ts +0 -14
  1254. package/bundle/src/codex-protocol/v2/ThreadRollbackResponse.ts +0 -15
  1255. package/bundle/src/codex-protocol/v2/ThreadSetNameParams.ts +0 -5
  1256. package/bundle/src/codex-protocol/v2/ThreadSetNameResponse.ts +0 -5
  1257. package/bundle/src/codex-protocol/v2/ThreadShellCommandParams.ts +0 -14
  1258. package/bundle/src/codex-protocol/v2/ThreadShellCommandResponse.ts +0 -5
  1259. package/bundle/src/codex-protocol/v2/ThreadSortKey.ts +0 -5
  1260. package/bundle/src/codex-protocol/v2/ThreadSource.ts +0 -5
  1261. package/bundle/src/codex-protocol/v2/ThreadSourceKind.ts +0 -15
  1262. package/bundle/src/codex-protocol/v2/ThreadStartParams.ts +0 -33
  1263. package/bundle/src/codex-protocol/v2/ThreadStartResponse.ts +0 -30
  1264. package/bundle/src/codex-protocol/v2/ThreadStartSource.ts +0 -5
  1265. package/bundle/src/codex-protocol/v2/ThreadStartedNotification.ts +0 -6
  1266. package/bundle/src/codex-protocol/v2/ThreadStatus.ts +0 -10
  1267. package/bundle/src/codex-protocol/v2/ThreadStatusChangedNotification.ts +0 -6
  1268. package/bundle/src/codex-protocol/v2/ThreadTokenUsage.ts +0 -10
  1269. package/bundle/src/codex-protocol/v2/ThreadTokenUsageUpdatedNotification.ts +0 -10
  1270. package/bundle/src/codex-protocol/v2/ThreadUnarchiveParams.ts +0 -5
  1271. package/bundle/src/codex-protocol/v2/ThreadUnarchiveResponse.ts +0 -6
  1272. package/bundle/src/codex-protocol/v2/ThreadUnarchivedNotification.ts +0 -5
  1273. package/bundle/src/codex-protocol/v2/ThreadUnsubscribeParams.ts +0 -5
  1274. package/bundle/src/codex-protocol/v2/ThreadUnsubscribeResponse.ts +0 -6
  1275. package/bundle/src/codex-protocol/v2/ThreadUnsubscribeStatus.ts +0 -5
  1276. package/bundle/src/codex-protocol/v2/TokenUsageBreakdown.ts +0 -11
  1277. package/bundle/src/codex-protocol/v2/ToolRequestUserInputAnswer.ts +0 -8
  1278. package/bundle/src/codex-protocol/v2/ToolRequestUserInputOption.ts +0 -8
  1279. package/bundle/src/codex-protocol/v2/ToolRequestUserInputParams.ts +0 -14
  1280. package/bundle/src/codex-protocol/v2/ToolRequestUserInputQuestion.ts +0 -16
  1281. package/bundle/src/codex-protocol/v2/ToolRequestUserInputResponse.ts +0 -11
  1282. package/bundle/src/codex-protocol/v2/ToolsV2.ts +0 -6
  1283. package/bundle/src/codex-protocol/v2/Turn.ts +0 -36
  1284. package/bundle/src/codex-protocol/v2/TurnCompletedNotification.ts +0 -6
  1285. package/bundle/src/codex-protocol/v2/TurnDiffUpdatedNotification.ts +0 -9
  1286. package/bundle/src/codex-protocol/v2/TurnEnvironmentParams.ts +0 -6
  1287. package/bundle/src/codex-protocol/v2/TurnError.ts +0 -10
  1288. package/bundle/src/codex-protocol/v2/TurnInterruptParams.ts +0 -5
  1289. package/bundle/src/codex-protocol/v2/TurnInterruptResponse.ts +0 -5
  1290. package/bundle/src/codex-protocol/v2/TurnItemsView.ts +0 -5
  1291. package/bundle/src/codex-protocol/v2/TurnPlanStep.ts +0 -6
  1292. package/bundle/src/codex-protocol/v2/TurnPlanStepStatus.ts +0 -5
  1293. package/bundle/src/codex-protocol/v2/TurnPlanUpdatedNotification.ts +0 -11
  1294. package/bundle/src/codex-protocol/v2/TurnStartParams.ts +0 -48
  1295. package/bundle/src/codex-protocol/v2/TurnStartResponse.ts +0 -6
  1296. package/bundle/src/codex-protocol/v2/TurnStartedNotification.ts +0 -6
  1297. package/bundle/src/codex-protocol/v2/TurnStatus.ts +0 -5
  1298. package/bundle/src/codex-protocol/v2/TurnSteerParams.ts +0 -13
  1299. package/bundle/src/codex-protocol/v2/TurnSteerResponse.ts +0 -5
  1300. package/bundle/src/codex-protocol/v2/UserInput.ts +0 -18
  1301. package/bundle/src/codex-protocol/v2/WarningNotification.ts +0 -14
  1302. package/bundle/src/codex-protocol/v2/WebSearchAction.ts +0 -9
  1303. package/bundle/src/codex-protocol/v2/WindowsSandboxReadiness.ts +0 -5
  1304. package/bundle/src/codex-protocol/v2/WindowsSandboxReadinessResponse.ts +0 -6
  1305. package/bundle/src/codex-protocol/v2/WindowsSandboxSetupCompletedNotification.ts +0 -10
  1306. package/bundle/src/codex-protocol/v2/WindowsSandboxSetupMode.ts +0 -5
  1307. package/bundle/src/codex-protocol/v2/WindowsSandboxSetupStartParams.ts +0 -10
  1308. package/bundle/src/codex-protocol/v2/WindowsSandboxSetupStartResponse.ts +0 -5
  1309. package/bundle/src/codex-protocol/v2/WindowsWorldWritableWarningNotification.ts +0 -9
  1310. package/bundle/src/codex-protocol/v2/WriteStatus.ts +0 -5
  1311. package/bundle/src/codex-protocol/v2/index.ts +0 -446
  1312. package/bundle/src/utils/providers/openai/codex-rpc.ts +0 -238
  1313. package/bundle/src/utils/providers/openai/codex-worker.test.ts +0 -1006
  1314. package/bundle/src/utils/providers/openai/codex-worker.ts +0 -927
  1315. package/bundle/src/utils/providers/openai/openai-worker-pool-config.ts +0 -112
  1316. package/bundle/web-dist/client/assets/index-C24D5PiN.js +0 -106
  1317. package/bundle/web-dist/client/assets/index-CcMEpCgt.css +0 -1
  1318. package/bundle/web-dist/client/assets/logs-CIlZG6A3.js +0 -1
  1319. package/bundle/web-dist/client/assets/monit-DZFBMxKl.js +0 -1
  1320. package/bundle/web-dist/client/assets/routes-C3wlSNBL.js +0 -5
  1321. package/bundle/web-dist/client/assets/services.generated-jGypfumC.js +0 -51
  1322. package/bundle/web-dist/client/assets/settings-ClRDWO-8.js +0 -1
  1323. package/bundle/web-dist/client/assets/show-BP7U8yyJ.js +0 -2
  1324. package/bundle/web-dist/client/assets/tokens-DfQeULnJ.js +0 -1
  1325. package/bundle/web-dist/client/assets/use-oauth-login-flow-CY-ASCfL.js +0 -1
  1326. package/bundle/web-dist/server/assets/lazyRouteComponent-DOc8TV-P.js +0 -1856
  1327. package/bundle/web-dist/server/assets/logs-CfF3nmLM.js +0 -451
  1328. package/bundle/web-dist/server/assets/monit-BSaKhh5D.js +0 -1577
  1329. package/bundle/web-dist/server/assets/plus-DLFUHsfx.js +0 -19
  1330. package/bundle/web-dist/server/assets/react-dom-BotjLnTK.js +0 -462
  1331. package/bundle/web-dist/server/assets/routes-CHMxrTT0.js +0 -2924
  1332. package/bundle/web-dist/server/assets/services.generated-D3Q3FYot.js +0 -23570
  1333. package/bundle/web-dist/server/assets/settings-DOQjV28c.js +0 -598
  1334. package/bundle/web-dist/server/assets/show-Cn_C6Qvl.js +0 -2776
  1335. package/bundle/web-dist/server/assets/tokens-c0EN3iCx.js +0 -441
  1336. package/bundle/web-dist/server/assets/use-oauth-login-flow-B68AbMDE.js +0 -160
  1337. /package/bundle/dist/{codex-protocol/AbsolutePathBuf.js → utils/providers/common/provider-types.js} +0 -0
@@ -0,0 +1,2924 @@
1
+ import { H as __toESM, S as require_react, b as useQueryClient, n as QgridService, o as TokenService, x as require_jsx_runtime } from "./services.generated-DyPeBI00.js";
2
+ import { t as require_react_dom } from "./react-dom-zmEq8BVp.js";
3
+ import { i as Q } from "../entry-server.generated.js";
4
+ import { r as formatUsd } from "./cost-CSH_t17I.js";
5
+ import { n as OAuthCodeEntry, r as useUpdateTokenMutation, t as useOAuthLoginFlow } from "./use-oauth-login-flow-DmsHGOlx.js";
6
+ //#region ../../node_modules/.pnpm/@dnd-kit+utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js
7
+ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom());
8
+ var import_react = /* @__PURE__ */ __toESM(require_react());
9
+ function useCombinedRefs() {
10
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
11
+ return (0, import_react.useMemo)(() => (node) => {
12
+ refs.forEach((ref) => ref(node));
13
+ }, refs);
14
+ }
15
+ var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
16
+ function isWindow(element) {
17
+ const elementString = Object.prototype.toString.call(element);
18
+ return elementString === "[object Window]" || elementString === "[object global]";
19
+ }
20
+ function isNode(node) {
21
+ return "nodeType" in node;
22
+ }
23
+ function getWindow(target) {
24
+ var _target$ownerDocument, _target$ownerDocument2;
25
+ if (!target) return window;
26
+ if (isWindow(target)) return target;
27
+ if (!isNode(target)) return window;
28
+ return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;
29
+ }
30
+ function isDocument(node) {
31
+ const { Document } = getWindow(node);
32
+ return node instanceof Document;
33
+ }
34
+ function isHTMLElement(node) {
35
+ if (isWindow(node)) return false;
36
+ return node instanceof getWindow(node).HTMLElement;
37
+ }
38
+ function isSVGElement(node) {
39
+ return node instanceof getWindow(node).SVGElement;
40
+ }
41
+ function getOwnerDocument(target) {
42
+ if (!target) return document;
43
+ if (isWindow(target)) return target.document;
44
+ if (!isNode(target)) return document;
45
+ if (isDocument(target)) return target;
46
+ if (isHTMLElement(target) || isSVGElement(target)) return target.ownerDocument;
47
+ return document;
48
+ }
49
+ /**
50
+ * A hook that resolves to useEffect on the server and useLayoutEffect on the client
51
+ * @param callback {function} Callback function that is invoked when the dependencies of the hook change
52
+ */
53
+ var useIsomorphicLayoutEffect = canUseDOM ? import_react.useLayoutEffect : import_react.useEffect;
54
+ function useEvent(handler) {
55
+ const handlerRef = (0, import_react.useRef)(handler);
56
+ useIsomorphicLayoutEffect(() => {
57
+ handlerRef.current = handler;
58
+ });
59
+ return (0, import_react.useCallback)(function() {
60
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
61
+ return handlerRef.current == null ? void 0 : handlerRef.current(...args);
62
+ }, []);
63
+ }
64
+ function useInterval() {
65
+ const intervalRef = (0, import_react.useRef)(null);
66
+ return [(0, import_react.useCallback)((listener, duration) => {
67
+ intervalRef.current = setInterval(listener, duration);
68
+ }, []), (0, import_react.useCallback)(() => {
69
+ if (intervalRef.current !== null) {
70
+ clearInterval(intervalRef.current);
71
+ intervalRef.current = null;
72
+ }
73
+ }, [])];
74
+ }
75
+ function useLazyMemo(callback, dependencies) {
76
+ const valueRef = (0, import_react.useRef)();
77
+ return (0, import_react.useMemo)(() => {
78
+ const newValue = callback(valueRef.current);
79
+ valueRef.current = newValue;
80
+ return newValue;
81
+ }, [...dependencies]);
82
+ }
83
+ function useNodeRef(onChange) {
84
+ const onChangeHandler = useEvent(onChange);
85
+ const node = (0, import_react.useRef)(null);
86
+ return [node, (0, import_react.useCallback)((element) => {
87
+ if (element !== node.current) onChangeHandler?.(element, node.current);
88
+ node.current = element;
89
+ }, [])];
90
+ }
91
+ var ids = {};
92
+ function useUniqueId(prefix, value) {
93
+ return (0, import_react.useMemo)(() => {
94
+ if (value) return value;
95
+ const id = ids[prefix] == null ? 0 : ids[prefix] + 1;
96
+ ids[prefix] = id;
97
+ return prefix + "-" + id;
98
+ }, [prefix, value]);
99
+ }
100
+ function createAdjustmentFn(modifier) {
101
+ return function(object) {
102
+ for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) adjustments[_key - 1] = arguments[_key];
103
+ return adjustments.reduce((accumulator, adjustment) => {
104
+ const entries = Object.entries(adjustment);
105
+ for (const [key, valueAdjustment] of entries) {
106
+ const value = accumulator[key];
107
+ if (value != null) accumulator[key] = value + modifier * valueAdjustment;
108
+ }
109
+ return accumulator;
110
+ }, { ...object });
111
+ };
112
+ }
113
+ var add = /* @__PURE__ */ createAdjustmentFn(1);
114
+ var subtract = /* @__PURE__ */ createAdjustmentFn(-1);
115
+ function hasViewportRelativeCoordinates(event) {
116
+ return "clientX" in event && "clientY" in event;
117
+ }
118
+ function isKeyboardEvent(event) {
119
+ if (!event) return false;
120
+ const { KeyboardEvent } = getWindow(event.target);
121
+ return KeyboardEvent && event instanceof KeyboardEvent;
122
+ }
123
+ function isTouchEvent(event) {
124
+ if (!event) return false;
125
+ const { TouchEvent } = getWindow(event.target);
126
+ return TouchEvent && event instanceof TouchEvent;
127
+ }
128
+ /**
129
+ * Returns the normalized x and y coordinates for mouse and touch events.
130
+ */
131
+ function getEventCoordinates(event) {
132
+ if (isTouchEvent(event)) {
133
+ if (event.touches && event.touches.length) {
134
+ const { clientX: x, clientY: y } = event.touches[0];
135
+ return {
136
+ x,
137
+ y
138
+ };
139
+ } else if (event.changedTouches && event.changedTouches.length) {
140
+ const { clientX: x, clientY: y } = event.changedTouches[0];
141
+ return {
142
+ x,
143
+ y
144
+ };
145
+ }
146
+ }
147
+ if (hasViewportRelativeCoordinates(event)) return {
148
+ x: event.clientX,
149
+ y: event.clientY
150
+ };
151
+ return null;
152
+ }
153
+ var CSS = /* @__PURE__ */ Object.freeze({
154
+ Translate: { toString(transform) {
155
+ if (!transform) return;
156
+ const { x, y } = transform;
157
+ return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
158
+ } },
159
+ Scale: { toString(transform) {
160
+ if (!transform) return;
161
+ const { scaleX, scaleY } = transform;
162
+ return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
163
+ } },
164
+ Transform: { toString(transform) {
165
+ if (!transform) return;
166
+ return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
167
+ } },
168
+ Transition: { toString(_ref) {
169
+ let { property, duration, easing } = _ref;
170
+ return property + " " + duration + "ms " + easing;
171
+ } }
172
+ });
173
+ //#endregion
174
+ //#region ../../node_modules/.pnpm/@dnd-kit+accessibility@3.1.1_react@19.2.4/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js
175
+ var hiddenStyles = { display: "none" };
176
+ function HiddenText(_ref) {
177
+ let { id, value } = _ref;
178
+ return import_react.createElement("div", {
179
+ id,
180
+ style: hiddenStyles
181
+ }, value);
182
+ }
183
+ function LiveRegion(_ref) {
184
+ let { id, announcement, ariaLiveType = "assertive" } = _ref;
185
+ return import_react.createElement("div", {
186
+ id,
187
+ style: {
188
+ position: "fixed",
189
+ top: 0,
190
+ left: 0,
191
+ width: 1,
192
+ height: 1,
193
+ margin: -1,
194
+ border: 0,
195
+ padding: 0,
196
+ overflow: "hidden",
197
+ clip: "rect(0 0 0 0)",
198
+ clipPath: "inset(100%)",
199
+ whiteSpace: "nowrap"
200
+ },
201
+ role: "status",
202
+ "aria-live": ariaLiveType,
203
+ "aria-atomic": true
204
+ }, announcement);
205
+ }
206
+ function useAnnouncement() {
207
+ const [announcement, setAnnouncement] = (0, import_react.useState)("");
208
+ return {
209
+ announce: (0, import_react.useCallback)((value) => {
210
+ if (value != null) setAnnouncement(value);
211
+ }, []),
212
+ announcement
213
+ };
214
+ }
215
+ //#endregion
216
+ //#region ../../node_modules/.pnpm/@dnd-kit+core@4.0.3_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@dnd-kit/core/dist/core.esm.js
217
+ var screenReaderInstructions = { draggable: `
218
+ To pick up a draggable item, press the space bar.
219
+ While dragging, use the arrow keys to move the item.
220
+ Press space again to drop the item in its new position, or press escape to cancel.
221
+ ` };
222
+ var defaultAnnouncements = {
223
+ onDragStart(id) {
224
+ return `Picked up draggable item ${id}.`;
225
+ },
226
+ onDragOver(id, overId) {
227
+ if (overId) return `Draggable item ${id} was moved over droppable area ${overId}.`;
228
+ return `Draggable item ${id} is no longer over a droppable area.`;
229
+ },
230
+ onDragEnd(id, overId) {
231
+ if (overId) return `Draggable item ${id} was dropped over droppable area ${overId}`;
232
+ return `Draggable item ${id} was dropped.`;
233
+ },
234
+ onDragCancel(id) {
235
+ return `Dragging was cancelled. Draggable item ${id} was dropped.`;
236
+ }
237
+ };
238
+ var Action;
239
+ (function(Action) {
240
+ Action["DragStart"] = "dragStart";
241
+ Action["DragMove"] = "dragMove";
242
+ Action["DragEnd"] = "dragEnd";
243
+ Action["DragCancel"] = "dragCancel";
244
+ Action["DragOver"] = "dragOver";
245
+ Action["RegisterDroppable"] = "registerDroppable";
246
+ Action["SetDroppableDisabled"] = "setDroppableDisabled";
247
+ Action["UnregisterDroppable"] = "unregisterDroppable";
248
+ })(Action || (Action = {}));
249
+ function noop(..._args) {}
250
+ var DroppableContainersMap = class extends Map {
251
+ get(id) {
252
+ var _super$get;
253
+ return id != null ? (_super$get = super.get(id)) != null ? _super$get : void 0 : void 0;
254
+ }
255
+ toArray() {
256
+ return Array.from(this.values());
257
+ }
258
+ getEnabled() {
259
+ return this.toArray().filter(({ disabled }) => !disabled);
260
+ }
261
+ getNodeFor(id) {
262
+ var _this$get$node$curren, _this$get;
263
+ return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : void 0;
264
+ }
265
+ };
266
+ var Context$1 = /* @__PURE__ */ (0, import_react.createContext)({
267
+ activatorEvent: null,
268
+ active: null,
269
+ activeNode: null,
270
+ activeNodeRect: null,
271
+ activeNodeClientRect: null,
272
+ activators: [],
273
+ ariaDescribedById: { draggable: "" },
274
+ containerNodeRect: null,
275
+ dispatch: noop,
276
+ draggableNodes: {},
277
+ droppableRects: /* @__PURE__ */ new Map(),
278
+ droppableContainers: /* @__PURE__ */ new DroppableContainersMap(),
279
+ over: null,
280
+ dragOverlay: {
281
+ nodeRef: { current: null },
282
+ rect: null,
283
+ setRef: noop
284
+ },
285
+ scrollableAncestors: [],
286
+ scrollableAncestorRects: [],
287
+ recomputeLayouts: noop,
288
+ windowRect: null,
289
+ willRecomputeLayouts: false
290
+ });
291
+ function getInitialState() {
292
+ return {
293
+ draggable: {
294
+ active: null,
295
+ initialCoordinates: {
296
+ x: 0,
297
+ y: 0
298
+ },
299
+ nodes: {},
300
+ translate: {
301
+ x: 0,
302
+ y: 0
303
+ }
304
+ },
305
+ droppable: { containers: new DroppableContainersMap() }
306
+ };
307
+ }
308
+ function reducer(state, action) {
309
+ switch (action.type) {
310
+ case Action.DragStart: return {
311
+ ...state,
312
+ draggable: {
313
+ ...state.draggable,
314
+ initialCoordinates: action.initialCoordinates,
315
+ active: action.active
316
+ }
317
+ };
318
+ case Action.DragMove:
319
+ if (!state.draggable.active) return state;
320
+ return {
321
+ ...state,
322
+ draggable: {
323
+ ...state.draggable,
324
+ translate: {
325
+ x: action.coordinates.x - state.draggable.initialCoordinates.x,
326
+ y: action.coordinates.y - state.draggable.initialCoordinates.y
327
+ }
328
+ }
329
+ };
330
+ case Action.DragEnd:
331
+ case Action.DragCancel: return {
332
+ ...state,
333
+ draggable: {
334
+ ...state.draggable,
335
+ active: null,
336
+ initialCoordinates: {
337
+ x: 0,
338
+ y: 0
339
+ },
340
+ translate: {
341
+ x: 0,
342
+ y: 0
343
+ }
344
+ }
345
+ };
346
+ case Action.RegisterDroppable: {
347
+ const { element } = action;
348
+ const { id } = element;
349
+ const containers = new DroppableContainersMap(state.droppable.containers);
350
+ containers.set(id, element);
351
+ return {
352
+ ...state,
353
+ droppable: {
354
+ ...state.droppable,
355
+ containers
356
+ }
357
+ };
358
+ }
359
+ case Action.SetDroppableDisabled: {
360
+ const { id, key, disabled } = action;
361
+ const element = state.droppable.containers.get(id);
362
+ if (!element || key !== element.key) return state;
363
+ const containers = new DroppableContainersMap(state.droppable.containers);
364
+ containers.set(id, {
365
+ ...element,
366
+ disabled
367
+ });
368
+ return {
369
+ ...state,
370
+ droppable: {
371
+ ...state.droppable,
372
+ containers
373
+ }
374
+ };
375
+ }
376
+ case Action.UnregisterDroppable: {
377
+ const { id, key } = action;
378
+ const element = state.droppable.containers.get(id);
379
+ if (!element || key !== element.key) return state;
380
+ const containers = new DroppableContainersMap(state.droppable.containers);
381
+ containers.delete(id);
382
+ return {
383
+ ...state,
384
+ droppable: {
385
+ ...state.droppable,
386
+ containers
387
+ }
388
+ };
389
+ }
390
+ default: return state;
391
+ }
392
+ }
393
+ var DndMonitorContext = /* @__PURE__ */ (0, import_react.createContext)({
394
+ type: null,
395
+ event: null
396
+ });
397
+ function useDndMonitor({ onDragStart, onDragMove, onDragOver, onDragEnd, onDragCancel }) {
398
+ const monitorState = (0, import_react.useContext)(DndMonitorContext);
399
+ const previousMonitorState = (0, import_react.useRef)(monitorState);
400
+ (0, import_react.useEffect)(() => {
401
+ if (monitorState !== previousMonitorState.current) {
402
+ const { type, event } = monitorState;
403
+ switch (type) {
404
+ case Action.DragStart:
405
+ onDragStart?.(event);
406
+ break;
407
+ case Action.DragMove:
408
+ onDragMove?.(event);
409
+ break;
410
+ case Action.DragOver:
411
+ onDragOver?.(event);
412
+ break;
413
+ case Action.DragCancel:
414
+ onDragCancel?.(event);
415
+ break;
416
+ case Action.DragEnd:
417
+ onDragEnd?.(event);
418
+ break;
419
+ }
420
+ previousMonitorState.current = monitorState;
421
+ }
422
+ }, [
423
+ monitorState,
424
+ onDragStart,
425
+ onDragMove,
426
+ onDragOver,
427
+ onDragEnd,
428
+ onDragCancel
429
+ ]);
430
+ }
431
+ function Accessibility({ announcements = defaultAnnouncements, hiddenTextDescribedById, screenReaderInstructions }) {
432
+ const { announce, announcement } = useAnnouncement();
433
+ const liveRegionId = useUniqueId(`DndLiveRegion`);
434
+ const [mounted, setMounted] = (0, import_react.useState)(false);
435
+ (0, import_react.useEffect)(() => {
436
+ setMounted(true);
437
+ }, []);
438
+ useDndMonitor((0, import_react.useMemo)(() => ({
439
+ onDragStart({ active }) {
440
+ announce(announcements.onDragStart(active.id));
441
+ },
442
+ onDragMove({ active, over }) {
443
+ if (announcements.onDragMove) announce(announcements.onDragMove(active.id, over == null ? void 0 : over.id));
444
+ },
445
+ onDragOver({ active, over }) {
446
+ announce(announcements.onDragOver(active.id, over == null ? void 0 : over.id));
447
+ },
448
+ onDragEnd({ active, over }) {
449
+ announce(announcements.onDragEnd(active.id, over == null ? void 0 : over.id));
450
+ },
451
+ onDragCancel({ active }) {
452
+ announce(announcements.onDragCancel(active.id));
453
+ }
454
+ }), [announce, announcements]));
455
+ return mounted ? (0, import_react_dom.createPortal)(import_react.createElement(import_react.Fragment, null, import_react.createElement(HiddenText, {
456
+ id: hiddenTextDescribedById,
457
+ value: screenReaderInstructions.draggable
458
+ }), import_react.createElement(LiveRegion, {
459
+ id: liveRegionId,
460
+ announcement
461
+ })), document.body) : null;
462
+ }
463
+ var defaultCoordinates = /* @__PURE__ */ Object.freeze({
464
+ x: 0,
465
+ y: 0
466
+ });
467
+ /**
468
+ * Returns the distance between two points
469
+ */
470
+ function distanceBetween(p1, p2) {
471
+ return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
472
+ }
473
+ /**
474
+ * Returns the coordinates of the center of a given ClientRect
475
+ */
476
+ function centerOfRectangle(rect, left = rect.offsetLeft, top = rect.offsetTop) {
477
+ return {
478
+ x: left + rect.width * .5,
479
+ y: top + rect.height * .5
480
+ };
481
+ }
482
+ /**
483
+ * Returns the closest rectangle from an array of rectangles to the center of a given
484
+ * rectangle.
485
+ */
486
+ var closestCenter = ({ collisionRect, droppableContainers }) => {
487
+ const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top);
488
+ let minDistanceToCenter = Infinity;
489
+ let minDroppableContainer = null;
490
+ for (const droppableContainer of droppableContainers) {
491
+ const { rect: { current: rect } } = droppableContainer;
492
+ if (rect) {
493
+ const distBetween = distanceBetween(centerOfRectangle(rect), centerRect);
494
+ if (distBetween < minDistanceToCenter) {
495
+ minDistanceToCenter = distBetween;
496
+ minDroppableContainer = droppableContainer.id;
497
+ }
498
+ }
499
+ }
500
+ return minDroppableContainer;
501
+ };
502
+ function adjustScale(transform, rect1, rect2) {
503
+ return {
504
+ ...transform,
505
+ scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1,
506
+ scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1
507
+ };
508
+ }
509
+ function getRectDelta(rect1, rect2) {
510
+ return rect1 && rect2 ? {
511
+ x: rect1.left - rect2.left,
512
+ y: rect1.top - rect2.top
513
+ } : defaultCoordinates;
514
+ }
515
+ function createRectAdjustmentFn(modifier) {
516
+ return function adjustViewRect(viewRect, ...adjustments) {
517
+ return adjustments.reduce((acc, adjustment) => ({
518
+ ...acc,
519
+ top: acc.top + modifier * adjustment.y,
520
+ bottom: acc.bottom + modifier * adjustment.y,
521
+ left: acc.left + modifier * adjustment.x,
522
+ right: acc.right + modifier * adjustment.x,
523
+ offsetLeft: acc.offsetLeft + modifier * adjustment.x,
524
+ offsetTop: acc.offsetTop + modifier * adjustment.y
525
+ }), { ...viewRect });
526
+ };
527
+ }
528
+ var getAdjustedRect = /* @__PURE__ */ createRectAdjustmentFn(1);
529
+ function isFixed(node, computedStyle = window.getComputedStyle(node)) {
530
+ return computedStyle.position === "fixed";
531
+ }
532
+ function isScrollable(node, computedStyle = window.getComputedStyle(node)) {
533
+ const overflowRegex = /(auto|scroll|overlay)/;
534
+ return [
535
+ "overflow",
536
+ "overflowX",
537
+ "overflowY"
538
+ ].find((property) => {
539
+ const value = computedStyle[property];
540
+ return typeof value === "string" ? overflowRegex.test(value) : false;
541
+ }) != null;
542
+ }
543
+ function getScrollableAncestors(element) {
544
+ const scrollParents = [];
545
+ function findScrollableAncestors(node) {
546
+ if (!node) return scrollParents;
547
+ if (isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) {
548
+ scrollParents.push(node.scrollingElement);
549
+ return scrollParents;
550
+ }
551
+ if (!isHTMLElement(node) || isSVGElement(node)) return scrollParents;
552
+ if (scrollParents.includes(node)) return scrollParents;
553
+ const computedStyle = window.getComputedStyle(node);
554
+ if (isScrollable(node, computedStyle)) scrollParents.push(node);
555
+ if (isFixed(node, computedStyle)) return scrollParents;
556
+ return findScrollableAncestors(node.parentNode);
557
+ }
558
+ return element ? findScrollableAncestors(element.parentNode) : scrollParents;
559
+ }
560
+ function getScrollableElement(element) {
561
+ if (!canUseDOM || !element) return null;
562
+ if (isWindow(element)) return element;
563
+ if (!isNode(element)) return null;
564
+ if (isDocument(element) || element === getOwnerDocument(element).scrollingElement) return window;
565
+ if (isHTMLElement(element)) return element;
566
+ return null;
567
+ }
568
+ function getScrollCoordinates(element) {
569
+ if (isWindow(element)) return {
570
+ x: element.scrollX,
571
+ y: element.scrollY
572
+ };
573
+ return {
574
+ x: element.scrollLeft,
575
+ y: element.scrollTop
576
+ };
577
+ }
578
+ var Direction;
579
+ (function(Direction) {
580
+ Direction[Direction["Forward"] = 1] = "Forward";
581
+ Direction[Direction["Backward"] = -1] = "Backward";
582
+ })(Direction || (Direction = {}));
583
+ function getScrollPosition(scrollingContainer) {
584
+ const minScroll = {
585
+ x: 0,
586
+ y: 0
587
+ };
588
+ const maxScroll = {
589
+ x: scrollingContainer.scrollWidth - scrollingContainer.clientWidth,
590
+ y: scrollingContainer.scrollHeight - scrollingContainer.clientHeight
591
+ };
592
+ return {
593
+ isTop: scrollingContainer.scrollTop <= minScroll.y,
594
+ isLeft: scrollingContainer.scrollLeft <= minScroll.x,
595
+ isBottom: scrollingContainer.scrollTop >= maxScroll.y,
596
+ isRight: scrollingContainer.scrollLeft >= maxScroll.x,
597
+ maxScroll,
598
+ minScroll
599
+ };
600
+ }
601
+ function isDocumentScrollingElement(element) {
602
+ if (!canUseDOM || !element) return false;
603
+ return element === document.scrollingElement;
604
+ }
605
+ var defaultThreshold = {
606
+ x: .2,
607
+ y: .2
608
+ };
609
+ function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, { top, left, right, bottom }, acceleration = 10, thresholdPercentage = defaultThreshold) {
610
+ const { clientHeight, clientWidth } = scrollContainer;
611
+ const finalScrollContainerRect = isDocumentScrollingElement(scrollContainer) ? {
612
+ top: 0,
613
+ left: 0,
614
+ right: clientWidth,
615
+ bottom: clientHeight,
616
+ width: clientWidth,
617
+ height: clientHeight
618
+ } : scrollContainerRect;
619
+ const { isTop, isBottom, isLeft, isRight } = getScrollPosition(scrollContainer);
620
+ const direction = {
621
+ x: 0,
622
+ y: 0
623
+ };
624
+ const speed = {
625
+ x: 0,
626
+ y: 0
627
+ };
628
+ const threshold = {
629
+ height: finalScrollContainerRect.height * thresholdPercentage.y,
630
+ width: finalScrollContainerRect.width * thresholdPercentage.x
631
+ };
632
+ if (!isTop && top <= finalScrollContainerRect.top + threshold.height) {
633
+ direction.y = Direction.Backward;
634
+ speed.y = acceleration * Math.abs((finalScrollContainerRect.top + threshold.height - top) / threshold.height);
635
+ } else if (!isBottom && bottom >= finalScrollContainerRect.bottom - threshold.height) {
636
+ direction.y = Direction.Forward;
637
+ speed.y = acceleration * Math.abs((finalScrollContainerRect.bottom - threshold.height - bottom) / threshold.height);
638
+ }
639
+ if (!isRight && right >= finalScrollContainerRect.right - threshold.width) {
640
+ direction.x = Direction.Forward;
641
+ speed.x = acceleration * Math.abs((finalScrollContainerRect.right - threshold.width - right) / threshold.width);
642
+ } else if (!isLeft && left <= finalScrollContainerRect.left + threshold.width) {
643
+ direction.x = Direction.Backward;
644
+ speed.x = acceleration * Math.abs((finalScrollContainerRect.left + threshold.width - left) / threshold.width);
645
+ }
646
+ return {
647
+ direction,
648
+ speed
649
+ };
650
+ }
651
+ function getScrollElementRect(element) {
652
+ if (element === document.scrollingElement) {
653
+ const { innerWidth, innerHeight } = window;
654
+ return {
655
+ top: 0,
656
+ left: 0,
657
+ right: innerWidth,
658
+ bottom: innerHeight,
659
+ width: innerWidth,
660
+ height: innerHeight
661
+ };
662
+ }
663
+ const { top, left, right, bottom } = element.getBoundingClientRect();
664
+ return {
665
+ top,
666
+ left,
667
+ right,
668
+ bottom,
669
+ width: element.clientWidth,
670
+ height: element.clientHeight
671
+ };
672
+ }
673
+ function getScrollOffsets(scrollableAncestors) {
674
+ return scrollableAncestors.reduce((acc, node) => {
675
+ return add(acc, getScrollCoordinates(node));
676
+ }, defaultCoordinates);
677
+ }
678
+ function getEdgeOffset(node, parent, offset = defaultCoordinates) {
679
+ if (!node || !isHTMLElement(node)) return offset;
680
+ const nodeOffset = {
681
+ x: offset.x + node.offsetLeft,
682
+ y: offset.y + node.offsetTop
683
+ };
684
+ if (node.offsetParent === parent) return nodeOffset;
685
+ return getEdgeOffset(node.offsetParent, parent, nodeOffset);
686
+ }
687
+ function getLayoutRect(element) {
688
+ const { offsetWidth: width, offsetHeight: height } = element;
689
+ const { x: offsetLeft, y: offsetTop } = getEdgeOffset(element, null);
690
+ return {
691
+ width,
692
+ height,
693
+ offsetTop,
694
+ offsetLeft
695
+ };
696
+ }
697
+ function getBoundingClientRect(element) {
698
+ if (isWindow(element)) {
699
+ const width = window.innerWidth;
700
+ const height = window.innerHeight;
701
+ return {
702
+ top: 0,
703
+ left: 0,
704
+ right: width,
705
+ bottom: height,
706
+ width,
707
+ height,
708
+ offsetTop: 0,
709
+ offsetLeft: 0
710
+ };
711
+ }
712
+ const { offsetTop, offsetLeft } = getLayoutRect(element);
713
+ const { width, height, top, bottom, left, right } = element.getBoundingClientRect();
714
+ return {
715
+ width,
716
+ height,
717
+ top,
718
+ bottom,
719
+ right,
720
+ left,
721
+ offsetTop,
722
+ offsetLeft
723
+ };
724
+ }
725
+ function getViewRect(element) {
726
+ const { width, height, offsetTop, offsetLeft } = getLayoutRect(element);
727
+ const scrollOffsets = getScrollOffsets(getScrollableAncestors(element));
728
+ const top = offsetTop - scrollOffsets.y;
729
+ const left = offsetLeft - scrollOffsets.x;
730
+ return {
731
+ width,
732
+ height,
733
+ top,
734
+ bottom: top + height,
735
+ right: left + width,
736
+ left,
737
+ offsetTop,
738
+ offsetLeft
739
+ };
740
+ }
741
+ /**
742
+ * Returns the intersecting rectangle area between two rectangles
743
+ */
744
+ function getIntersectionRatio(entry, target) {
745
+ const top = Math.max(target.top, entry.offsetTop);
746
+ const left = Math.max(target.left, entry.offsetLeft);
747
+ const right = Math.min(target.left + target.width, entry.offsetLeft + entry.width);
748
+ const bottom = Math.min(target.top + target.height, entry.offsetTop + entry.height);
749
+ const width = right - left;
750
+ const height = bottom - top;
751
+ if (left < right && top < bottom) {
752
+ const targetArea = target.width * target.height;
753
+ const entryArea = entry.width * entry.height;
754
+ const intersectionArea = width * height;
755
+ const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea);
756
+ return Number(intersectionRatio.toFixed(4));
757
+ }
758
+ return 0;
759
+ }
760
+ /**
761
+ * Returns the rectangle that has the greatest intersection area with a given
762
+ * rectangle in an array of rectangles.
763
+ */
764
+ var rectIntersection = ({ collisionRect, droppableContainers }) => {
765
+ let maxIntersectionRatio = 0;
766
+ let maxIntersectingDroppableContainer = null;
767
+ for (const droppableContainer of droppableContainers) {
768
+ const { rect: { current: rect } } = droppableContainer;
769
+ if (rect) {
770
+ const intersectionRatio = getIntersectionRatio(rect, collisionRect);
771
+ if (intersectionRatio > maxIntersectionRatio) {
772
+ maxIntersectionRatio = intersectionRatio;
773
+ maxIntersectingDroppableContainer = droppableContainer.id;
774
+ }
775
+ }
776
+ }
777
+ return maxIntersectingDroppableContainer;
778
+ };
779
+ var AutoScrollActivator;
780
+ (function(AutoScrollActivator) {
781
+ AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer";
782
+ AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect";
783
+ })(AutoScrollActivator || (AutoScrollActivator = {}));
784
+ var TraversalOrder;
785
+ (function(TraversalOrder) {
786
+ TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder";
787
+ TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder";
788
+ })(TraversalOrder || (TraversalOrder = {}));
789
+ function useAutoScroller({ acceleration, activator = AutoScrollActivator.Pointer, canScroll, draggingRect, enabled, interval = 5, order = TraversalOrder.TreeOrder, pointerCoordinates, scrollableAncestors, scrollableAncestorRects, threshold }) {
790
+ const [setAutoScrollInterval, clearAutoScrollInterval] = useInterval();
791
+ const scrollSpeed = (0, import_react.useRef)({
792
+ x: 1,
793
+ y: 1
794
+ });
795
+ const rect = (0, import_react.useMemo)(() => {
796
+ switch (activator) {
797
+ case AutoScrollActivator.Pointer: return pointerCoordinates ? {
798
+ top: pointerCoordinates.y,
799
+ bottom: pointerCoordinates.y,
800
+ left: pointerCoordinates.x,
801
+ right: pointerCoordinates.x
802
+ } : null;
803
+ case AutoScrollActivator.DraggableRect: return draggingRect;
804
+ }
805
+ return null;
806
+ }, [
807
+ activator,
808
+ draggingRect,
809
+ pointerCoordinates
810
+ ]);
811
+ const scrollDirection = (0, import_react.useRef)(defaultCoordinates);
812
+ const scrollContainerRef = (0, import_react.useRef)(null);
813
+ const autoScroll = (0, import_react.useCallback)(() => {
814
+ const scrollContainer = scrollContainerRef.current;
815
+ if (!scrollContainer) return;
816
+ const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x;
817
+ const scrollTop = scrollSpeed.current.y * scrollDirection.current.y;
818
+ scrollContainer.scrollBy(scrollLeft, scrollTop);
819
+ }, []);
820
+ const sortedScrollableAncestors = (0, import_react.useMemo)(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]);
821
+ (0, import_react.useEffect)(() => {
822
+ if (!enabled || !scrollableAncestors.length || !rect) {
823
+ clearAutoScrollInterval();
824
+ return;
825
+ }
826
+ for (const scrollContainer of sortedScrollableAncestors) {
827
+ if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) continue;
828
+ const scrolllContainerRect = scrollableAncestorRects[scrollableAncestors.indexOf(scrollContainer)];
829
+ if (!scrolllContainerRect) continue;
830
+ const { direction, speed } = getScrollDirectionAndSpeed(scrollContainer, scrolllContainerRect, rect, acceleration, threshold);
831
+ if (speed.x > 0 || speed.y > 0) {
832
+ clearAutoScrollInterval();
833
+ scrollContainerRef.current = scrollContainer;
834
+ setAutoScrollInterval(autoScroll, interval);
835
+ scrollSpeed.current = speed;
836
+ scrollDirection.current = direction;
837
+ return;
838
+ }
839
+ }
840
+ scrollSpeed.current = {
841
+ x: 0,
842
+ y: 0
843
+ };
844
+ scrollDirection.current = {
845
+ x: 0,
846
+ y: 0
847
+ };
848
+ clearAutoScrollInterval();
849
+ }, [
850
+ acceleration,
851
+ autoScroll,
852
+ canScroll,
853
+ clearAutoScrollInterval,
854
+ enabled,
855
+ interval,
856
+ JSON.stringify(rect),
857
+ setAutoScrollInterval,
858
+ scrollableAncestors,
859
+ sortedScrollableAncestors,
860
+ scrollableAncestorRects,
861
+ JSON.stringify(threshold)
862
+ ]);
863
+ }
864
+ function useCachedNode(draggableNodes, id) {
865
+ const draggableNode = id !== null ? draggableNodes[id] : void 0;
866
+ const node = draggableNode ? draggableNode.node.current : null;
867
+ return useLazyMemo((cachedNode) => {
868
+ var _ref;
869
+ if (id === null) return null;
870
+ return (_ref = node != null ? node : cachedNode) != null ? _ref : null;
871
+ }, [node, id]);
872
+ }
873
+ function useCombineActivators(sensors, getSyntheticHandler) {
874
+ return (0, import_react.useMemo)(() => sensors.reduce((accumulator, sensor) => {
875
+ const { sensor: Sensor } = sensor;
876
+ const sensorActivators = Sensor.activators.map((activator) => ({
877
+ eventName: activator.eventName,
878
+ handler: getSyntheticHandler(activator.handler, sensor)
879
+ }));
880
+ return [...accumulator, ...sensorActivators];
881
+ }, []), [sensors, getSyntheticHandler]);
882
+ }
883
+ function useData(data) {
884
+ const dataRef = (0, import_react.useRef)(data);
885
+ useIsomorphicLayoutEffect(() => {
886
+ if (dataRef.current !== data) dataRef.current = data;
887
+ }, [data]);
888
+ return dataRef;
889
+ }
890
+ var MeasuringStrategy;
891
+ (function(MeasuringStrategy) {
892
+ MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always";
893
+ MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging";
894
+ MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging";
895
+ })(MeasuringStrategy || (MeasuringStrategy = {}));
896
+ var MeasuringFrequency;
897
+ (function(MeasuringFrequency) {
898
+ MeasuringFrequency["Optimized"] = "optimized";
899
+ })(MeasuringFrequency || (MeasuringFrequency = {}));
900
+ var defaultValue = /* @__PURE__ */ new Map();
901
+ var defaultConfig = {
902
+ measure: getLayoutRect,
903
+ strategy: MeasuringStrategy.WhileDragging,
904
+ frequency: MeasuringFrequency.Optimized
905
+ };
906
+ function useDroppableMeasuring(containers, { dragging, dependencies, config }) {
907
+ const [willRecomputeLayouts, setWillRecomputeLayouts] = (0, import_react.useState)(false);
908
+ const { frequency, measure, strategy } = {
909
+ ...defaultConfig,
910
+ ...config
911
+ };
912
+ const containersRef = (0, import_react.useRef)(containers);
913
+ const recomputeLayouts = (0, import_react.useCallback)(() => setWillRecomputeLayouts(true), []);
914
+ const recomputeLayoutsTimeoutId = (0, import_react.useRef)(null);
915
+ const disabled = isDisabled();
916
+ const layoutRectMap = useLazyMemo((previousValue) => {
917
+ if (disabled && !dragging) return defaultValue;
918
+ if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || willRecomputeLayouts) {
919
+ for (let container of containers) {
920
+ if (!container) continue;
921
+ container.rect.current = container.node.current ? measure(container.node.current) : null;
922
+ }
923
+ return createLayoutRectMap(containers);
924
+ }
925
+ return previousValue;
926
+ }, [
927
+ containers,
928
+ dragging,
929
+ disabled,
930
+ measure,
931
+ willRecomputeLayouts
932
+ ]);
933
+ (0, import_react.useEffect)(() => {
934
+ containersRef.current = containers;
935
+ }, [containers]);
936
+ (0, import_react.useEffect)(() => {
937
+ if (willRecomputeLayouts) setWillRecomputeLayouts(false);
938
+ }, [willRecomputeLayouts]);
939
+ (0, import_react.useEffect)(function recompute() {
940
+ if (disabled) return;
941
+ requestAnimationFrame(recomputeLayouts);
942
+ }, [dragging, disabled]);
943
+ (0, import_react.useEffect)(function forceRecomputeLayouts() {
944
+ if (disabled || typeof frequency !== "number" || recomputeLayoutsTimeoutId.current !== null) return;
945
+ recomputeLayoutsTimeoutId.current = setTimeout(() => {
946
+ recomputeLayouts();
947
+ recomputeLayoutsTimeoutId.current = null;
948
+ }, frequency);
949
+ }, [
950
+ frequency,
951
+ disabled,
952
+ recomputeLayouts,
953
+ ...dependencies
954
+ ]);
955
+ return {
956
+ layoutRectMap,
957
+ recomputeLayouts,
958
+ willRecomputeLayouts
959
+ };
960
+ function isDisabled() {
961
+ switch (strategy) {
962
+ case MeasuringStrategy.Always: return false;
963
+ case MeasuringStrategy.BeforeDragging: return dragging;
964
+ default: return !dragging;
965
+ }
966
+ }
967
+ }
968
+ function createLayoutRectMap(containers) {
969
+ const layoutRectMap = /* @__PURE__ */ new Map();
970
+ if (containers) for (const container of containers) {
971
+ if (!container) continue;
972
+ const { id, rect } = container;
973
+ if (rect.current == null) continue;
974
+ layoutRectMap.set(id, rect.current);
975
+ }
976
+ return layoutRectMap;
977
+ }
978
+ function useScrollOffsets(elements) {
979
+ const [scrollCoordinates, setScrollCoordinates] = (0, import_react.useState)(null);
980
+ const prevElements = (0, import_react.useRef)(elements);
981
+ const handleScroll = (0, import_react.useCallback)((event) => {
982
+ const scrollingElement = getScrollableElement(event.target);
983
+ if (!scrollingElement) return;
984
+ setScrollCoordinates((scrollCoordinates) => {
985
+ if (!scrollCoordinates) return null;
986
+ scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement));
987
+ return new Map(scrollCoordinates);
988
+ });
989
+ }, []);
990
+ (0, import_react.useEffect)(() => {
991
+ const previousElements = prevElements.current;
992
+ if (elements !== previousElements) {
993
+ cleanup(previousElements);
994
+ const entries = elements.map((element) => {
995
+ const scrollableElement = getScrollableElement(element);
996
+ if (scrollableElement) {
997
+ scrollableElement.addEventListener("scroll", handleScroll, { passive: true });
998
+ return [scrollableElement, getScrollCoordinates(scrollableElement)];
999
+ }
1000
+ return null;
1001
+ }).filter((entry) => entry != null);
1002
+ setScrollCoordinates(entries.length ? new Map(entries) : null);
1003
+ prevElements.current = elements;
1004
+ }
1005
+ return () => {
1006
+ cleanup(elements);
1007
+ cleanup(previousElements);
1008
+ };
1009
+ function cleanup(elements) {
1010
+ elements.forEach((element) => {
1011
+ getScrollableElement(element)?.removeEventListener("scroll", handleScroll);
1012
+ });
1013
+ }
1014
+ }, [handleScroll, elements]);
1015
+ return (0, import_react.useMemo)(() => {
1016
+ if (elements.length) return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => add(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements);
1017
+ return defaultCoordinates;
1018
+ }, [elements, scrollCoordinates]);
1019
+ }
1020
+ var defaultValue$1 = [];
1021
+ function useScrollableAncestors(node) {
1022
+ const previousNode = (0, import_react.useRef)(node);
1023
+ const ancestors = useLazyMemo((previousValue) => {
1024
+ if (!node) return defaultValue$1;
1025
+ if (previousValue && node && previousNode.current && node.parentNode === previousNode.current.parentNode) return previousValue;
1026
+ return getScrollableAncestors(node);
1027
+ }, [node]);
1028
+ (0, import_react.useEffect)(() => {
1029
+ previousNode.current = node;
1030
+ }, [node]);
1031
+ return ancestors;
1032
+ }
1033
+ function useSensorSetup(sensors) {
1034
+ (0, import_react.useEffect)(() => {
1035
+ if (!canUseDOM) return;
1036
+ const teardownFns = sensors.map(({ sensor }) => sensor.setup == null ? void 0 : sensor.setup());
1037
+ return () => {
1038
+ for (const teardown of teardownFns) teardown?.();
1039
+ };
1040
+ }, sensors.map(({ sensor }) => sensor));
1041
+ }
1042
+ function useSyntheticListeners(listeners, id) {
1043
+ return (0, import_react.useMemo)(() => {
1044
+ return listeners.reduce((acc, { eventName, handler }) => {
1045
+ acc[eventName] = (event) => {
1046
+ handler(event, id);
1047
+ };
1048
+ return acc;
1049
+ }, {});
1050
+ }, [listeners, id]);
1051
+ }
1052
+ var useClientRect = /* @__PURE__ */ createUseRectFn(getBoundingClientRect);
1053
+ var useClientRects = /* @__PURE__ */ createUseRectsFn(getBoundingClientRect);
1054
+ function useRect(element, getRect, forceRecompute) {
1055
+ const previousElement = (0, import_react.useRef)(element);
1056
+ return useLazyMemo((previousValue) => {
1057
+ if (!element) return null;
1058
+ if (forceRecompute || !previousValue && element || element !== previousElement.current) {
1059
+ if (isHTMLElement(element) && element.parentNode == null) return null;
1060
+ return getRect(element);
1061
+ }
1062
+ return previousValue != null ? previousValue : null;
1063
+ }, [
1064
+ element,
1065
+ forceRecompute,
1066
+ getRect
1067
+ ]);
1068
+ }
1069
+ function createUseRectFn(getRect) {
1070
+ return (element, forceRecompute) => useRect(element, getRect, forceRecompute);
1071
+ }
1072
+ function createUseRectsFn(getRect) {
1073
+ const defaultValue = [];
1074
+ return function useRects(elements, forceRecompute) {
1075
+ const previousElements = (0, import_react.useRef)(elements);
1076
+ return useLazyMemo((previousValue) => {
1077
+ if (!elements.length) return defaultValue;
1078
+ if (forceRecompute || !previousValue && elements.length || elements !== previousElements.current) return elements.map((element) => getRect(element));
1079
+ return previousValue != null ? previousValue : defaultValue;
1080
+ }, [elements, forceRecompute]);
1081
+ };
1082
+ }
1083
+ function getMeasurableNode(node) {
1084
+ if (!node) return null;
1085
+ if (node.children.length > 1) return node;
1086
+ const firstChild = node.children[0];
1087
+ return isHTMLElement(firstChild) ? firstChild : node;
1088
+ }
1089
+ function getDragOverlayRect(element) {
1090
+ const { width, height, offsetLeft, offsetTop } = getLayoutRect(element);
1091
+ return {
1092
+ top: offsetTop,
1093
+ bottom: offsetTop + height,
1094
+ left: offsetLeft,
1095
+ right: offsetLeft + width,
1096
+ width,
1097
+ height,
1098
+ offsetTop,
1099
+ offsetLeft
1100
+ };
1101
+ }
1102
+ var useDragOverlayRect = /* @__PURE__ */ createUseRectFn(getDragOverlayRect);
1103
+ function useDragOverlayMeasuring({ disabled, forceRecompute }) {
1104
+ const [nodeRef, setRef] = useNodeRef();
1105
+ const rect = useDragOverlayRect(disabled ? null : getMeasurableNode(nodeRef.current), forceRecompute);
1106
+ return (0, import_react.useMemo)(() => ({
1107
+ nodeRef,
1108
+ rect,
1109
+ setRef
1110
+ }), [
1111
+ rect,
1112
+ nodeRef,
1113
+ setRef
1114
+ ]);
1115
+ }
1116
+ function useSensor(sensor, options) {
1117
+ return (0, import_react.useMemo)(() => ({
1118
+ sensor,
1119
+ options: options != null ? options : {}
1120
+ }), [sensor, options]);
1121
+ }
1122
+ function useSensors(...sensors) {
1123
+ return (0, import_react.useMemo)(() => [...sensors].filter((sensor) => sensor != null), [...sensors]);
1124
+ }
1125
+ var Listeners = class {
1126
+ constructor(target) {
1127
+ this.target = target;
1128
+ this.listeners = [];
1129
+ this.removeAll = () => {
1130
+ this.listeners.forEach((listener) => {
1131
+ var _this$target;
1132
+ return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener);
1133
+ });
1134
+ };
1135
+ }
1136
+ add(eventName, handler, options) {
1137
+ var _this$target2;
1138
+ (_this$target2 = this.target) == null || _this$target2.addEventListener(eventName, handler, options);
1139
+ this.listeners.push([
1140
+ eventName,
1141
+ handler,
1142
+ options
1143
+ ]);
1144
+ }
1145
+ };
1146
+ function getEventListenerTarget(target) {
1147
+ const { EventTarget } = getWindow(target);
1148
+ return target instanceof EventTarget ? target : getOwnerDocument(target);
1149
+ }
1150
+ function hasExceededDistance(delta, measurement) {
1151
+ const dx = Math.abs(delta.x);
1152
+ const dy = Math.abs(delta.y);
1153
+ if (typeof measurement === "number") return Math.sqrt(dx ** 2 + dy ** 2) > measurement;
1154
+ if ("x" in measurement && "y" in measurement) return dx > measurement.x && dy > measurement.y;
1155
+ if ("x" in measurement) return dx > measurement.x;
1156
+ if ("y" in measurement) return dy > measurement.y;
1157
+ return false;
1158
+ }
1159
+ var EventName;
1160
+ (function(EventName) {
1161
+ EventName["Click"] = "click";
1162
+ EventName["DragStart"] = "dragstart";
1163
+ EventName["Keydown"] = "keydown";
1164
+ EventName["ContextMenu"] = "contextmenu";
1165
+ EventName["Resize"] = "resize";
1166
+ EventName["SelectionChange"] = "selectionchange";
1167
+ EventName["VisibilityChange"] = "visibilitychange";
1168
+ })(EventName || (EventName = {}));
1169
+ function preventDefault(event) {
1170
+ event.preventDefault();
1171
+ }
1172
+ function stopPropagation(event) {
1173
+ event.stopPropagation();
1174
+ }
1175
+ var KeyboardCode;
1176
+ (function(KeyboardCode) {
1177
+ KeyboardCode["Space"] = "Space";
1178
+ KeyboardCode["Down"] = "ArrowDown";
1179
+ KeyboardCode["Right"] = "ArrowRight";
1180
+ KeyboardCode["Left"] = "ArrowLeft";
1181
+ KeyboardCode["Up"] = "ArrowUp";
1182
+ KeyboardCode["Esc"] = "Escape";
1183
+ KeyboardCode["Enter"] = "Enter";
1184
+ })(KeyboardCode || (KeyboardCode = {}));
1185
+ var defaultKeyboardCodes = {
1186
+ start: [KeyboardCode.Space, KeyboardCode.Enter],
1187
+ cancel: [KeyboardCode.Esc],
1188
+ end: [KeyboardCode.Space, KeyboardCode.Enter]
1189
+ };
1190
+ var defaultKeyboardCoordinateGetter = (event, { currentCoordinates }) => {
1191
+ switch (event.code) {
1192
+ case KeyboardCode.Right: return {
1193
+ ...currentCoordinates,
1194
+ x: currentCoordinates.x + 25
1195
+ };
1196
+ case KeyboardCode.Left: return {
1197
+ ...currentCoordinates,
1198
+ x: currentCoordinates.x - 25
1199
+ };
1200
+ case KeyboardCode.Down: return {
1201
+ ...currentCoordinates,
1202
+ y: currentCoordinates.y + 25
1203
+ };
1204
+ case KeyboardCode.Up: return {
1205
+ ...currentCoordinates,
1206
+ y: currentCoordinates.y - 25
1207
+ };
1208
+ }
1209
+ };
1210
+ var KeyboardSensor = class {
1211
+ constructor(props) {
1212
+ this.props = props;
1213
+ this.autoScrollEnabled = false;
1214
+ this.coordinates = defaultCoordinates;
1215
+ const { event: { target } } = props;
1216
+ this.props = props;
1217
+ this.listeners = new Listeners(getOwnerDocument(target));
1218
+ this.windowListeners = new Listeners(getWindow(target));
1219
+ this.handleKeyDown = this.handleKeyDown.bind(this);
1220
+ this.handleCancel = this.handleCancel.bind(this);
1221
+ this.attach();
1222
+ }
1223
+ attach() {
1224
+ this.handleStart();
1225
+ this.windowListeners.add(EventName.Resize, this.handleCancel);
1226
+ this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
1227
+ setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown));
1228
+ }
1229
+ handleStart() {
1230
+ const { activeNode, onStart } = this.props;
1231
+ if (!activeNode.node.current) throw new Error("Active draggable node is undefined");
1232
+ const activeNodeRect = getBoundingClientRect(activeNode.node.current);
1233
+ const coordinates = {
1234
+ x: activeNodeRect.left,
1235
+ y: activeNodeRect.top
1236
+ };
1237
+ this.coordinates = coordinates;
1238
+ onStart(coordinates);
1239
+ }
1240
+ handleKeyDown(event) {
1241
+ if (isKeyboardEvent(event)) {
1242
+ const { coordinates } = this;
1243
+ const { active, context, options } = this.props;
1244
+ const { keyboardCodes = defaultKeyboardCodes, coordinateGetter = defaultKeyboardCoordinateGetter, scrollBehavior = "smooth" } = options;
1245
+ const { code } = event;
1246
+ if (keyboardCodes.end.includes(code)) {
1247
+ this.handleEnd(event);
1248
+ return;
1249
+ }
1250
+ if (keyboardCodes.cancel.includes(code)) {
1251
+ this.handleCancel(event);
1252
+ return;
1253
+ }
1254
+ const newCoordinates = coordinateGetter(event, {
1255
+ active,
1256
+ context: context.current,
1257
+ currentCoordinates: coordinates
1258
+ });
1259
+ if (newCoordinates) {
1260
+ const scrollDelta = {
1261
+ x: 0,
1262
+ y: 0
1263
+ };
1264
+ const { scrollableAncestors } = context.current;
1265
+ for (const scrollContainer of scrollableAncestors) {
1266
+ const direction = event.code;
1267
+ const coordinatesDelta = subtract(newCoordinates, coordinates);
1268
+ const { isTop, isRight, isLeft, isBottom, maxScroll, minScroll } = getScrollPosition(scrollContainer);
1269
+ const scrollElementRect = getScrollElementRect(scrollContainer);
1270
+ const clampedCoordinates = {
1271
+ x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)),
1272
+ y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y))
1273
+ };
1274
+ const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft;
1275
+ const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop;
1276
+ if (canScrollX && clampedCoordinates.x !== newCoordinates.x) {
1277
+ if (direction === KeyboardCode.Right && scrollContainer.scrollLeft + coordinatesDelta.x <= maxScroll.x || direction === KeyboardCode.Left && scrollContainer.scrollLeft + coordinatesDelta.x >= minScroll.x) {
1278
+ scrollContainer.scrollBy({
1279
+ left: coordinatesDelta.x,
1280
+ behavior: scrollBehavior
1281
+ });
1282
+ return;
1283
+ }
1284
+ scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x;
1285
+ scrollContainer.scrollBy({
1286
+ left: -scrollDelta.x,
1287
+ behavior: scrollBehavior
1288
+ });
1289
+ break;
1290
+ } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) {
1291
+ if (direction === KeyboardCode.Down && scrollContainer.scrollTop + coordinatesDelta.y <= maxScroll.y || direction === KeyboardCode.Up && scrollContainer.scrollTop + coordinatesDelta.y >= minScroll.y) {
1292
+ scrollContainer.scrollBy({
1293
+ top: coordinatesDelta.y,
1294
+ behavior: scrollBehavior
1295
+ });
1296
+ return;
1297
+ }
1298
+ scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y;
1299
+ scrollContainer.scrollBy({
1300
+ top: -scrollDelta.y,
1301
+ behavior: scrollBehavior
1302
+ });
1303
+ break;
1304
+ }
1305
+ }
1306
+ this.handleMove(event, add(newCoordinates, scrollDelta));
1307
+ }
1308
+ }
1309
+ }
1310
+ handleMove(event, coordinates) {
1311
+ const { onMove } = this.props;
1312
+ event.preventDefault();
1313
+ onMove(coordinates);
1314
+ this.coordinates = coordinates;
1315
+ }
1316
+ handleEnd(event) {
1317
+ const { onEnd } = this.props;
1318
+ event.preventDefault();
1319
+ this.detach();
1320
+ onEnd();
1321
+ }
1322
+ handleCancel(event) {
1323
+ const { onCancel } = this.props;
1324
+ event.preventDefault();
1325
+ this.detach();
1326
+ onCancel();
1327
+ }
1328
+ detach() {
1329
+ this.listeners.removeAll();
1330
+ this.windowListeners.removeAll();
1331
+ }
1332
+ };
1333
+ KeyboardSensor.activators = [{
1334
+ eventName: "onKeyDown",
1335
+ handler: (event, { keyboardCodes = defaultKeyboardCodes, onActivation }) => {
1336
+ const { code } = event.nativeEvent;
1337
+ if (keyboardCodes.start.includes(code)) {
1338
+ event.preventDefault();
1339
+ onActivation?.({ event: event.nativeEvent });
1340
+ return true;
1341
+ }
1342
+ return false;
1343
+ }
1344
+ }];
1345
+ function isDistanceConstraint(constraint) {
1346
+ return Boolean(constraint && "distance" in constraint);
1347
+ }
1348
+ function isDelayConstraint(constraint) {
1349
+ return Boolean(constraint && "delay" in constraint);
1350
+ }
1351
+ var AbstractPointerSensor = class {
1352
+ constructor(props, events, listenerTarget = getEventListenerTarget(props.event.target)) {
1353
+ this.props = props;
1354
+ this.events = events;
1355
+ this.autoScrollEnabled = true;
1356
+ this.activated = false;
1357
+ this.timeoutId = null;
1358
+ const { event } = props;
1359
+ const { target } = event;
1360
+ this.props = props;
1361
+ this.events = events;
1362
+ this.document = getOwnerDocument(target);
1363
+ this.documentListeners = new Listeners(this.document);
1364
+ this.listeners = new Listeners(listenerTarget);
1365
+ this.windowListeners = new Listeners(getWindow(target));
1366
+ this.initialCoordinates = getEventCoordinates(event);
1367
+ this.handleStart = this.handleStart.bind(this);
1368
+ this.handleMove = this.handleMove.bind(this);
1369
+ this.handleEnd = this.handleEnd.bind(this);
1370
+ this.handleCancel = this.handleCancel.bind(this);
1371
+ this.handleKeydown = this.handleKeydown.bind(this);
1372
+ this.removeTextSelection = this.removeTextSelection.bind(this);
1373
+ this.attach();
1374
+ }
1375
+ attach() {
1376
+ const { events, props: { options: { activationConstraint } } } = this;
1377
+ this.listeners.add(events.move.name, this.handleMove, { passive: false });
1378
+ this.listeners.add(events.end.name, this.handleEnd);
1379
+ this.windowListeners.add(EventName.Resize, this.handleCancel);
1380
+ this.windowListeners.add(EventName.DragStart, preventDefault);
1381
+ this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
1382
+ this.windowListeners.add(EventName.ContextMenu, preventDefault);
1383
+ this.documentListeners.add(EventName.Keydown, this.handleKeydown);
1384
+ if (activationConstraint) {
1385
+ if (isDistanceConstraint(activationConstraint)) return;
1386
+ if (isDelayConstraint(activationConstraint)) {
1387
+ this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay);
1388
+ return;
1389
+ }
1390
+ }
1391
+ this.handleStart();
1392
+ }
1393
+ detach() {
1394
+ this.listeners.removeAll();
1395
+ this.windowListeners.removeAll();
1396
+ setTimeout(this.documentListeners.removeAll, 50);
1397
+ if (this.timeoutId !== null) {
1398
+ clearTimeout(this.timeoutId);
1399
+ this.timeoutId = null;
1400
+ }
1401
+ }
1402
+ handleStart() {
1403
+ const { initialCoordinates } = this;
1404
+ const { onStart } = this.props;
1405
+ if (initialCoordinates) {
1406
+ this.activated = true;
1407
+ this.documentListeners.add(EventName.Click, stopPropagation, { capture: true });
1408
+ this.removeTextSelection();
1409
+ this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection);
1410
+ onStart(initialCoordinates);
1411
+ }
1412
+ }
1413
+ handleMove(event) {
1414
+ const { activated, initialCoordinates, props } = this;
1415
+ const { onMove, options: { activationConstraint } } = props;
1416
+ if (!initialCoordinates) return;
1417
+ const coordinates = getEventCoordinates(event);
1418
+ const delta = subtract(initialCoordinates, coordinates);
1419
+ if (!activated && activationConstraint) {
1420
+ if (isDelayConstraint(activationConstraint)) {
1421
+ if (hasExceededDistance(delta, activationConstraint.tolerance)) return this.handleCancel();
1422
+ return;
1423
+ }
1424
+ if (isDistanceConstraint(activationConstraint)) {
1425
+ if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) return this.handleCancel();
1426
+ if (hasExceededDistance(delta, activationConstraint.distance)) return this.handleStart();
1427
+ return;
1428
+ }
1429
+ }
1430
+ if (event.cancelable) event.preventDefault();
1431
+ onMove(coordinates);
1432
+ }
1433
+ handleEnd() {
1434
+ const { onEnd } = this.props;
1435
+ this.detach();
1436
+ onEnd();
1437
+ }
1438
+ handleCancel() {
1439
+ const { onCancel } = this.props;
1440
+ this.detach();
1441
+ onCancel();
1442
+ }
1443
+ handleKeydown(event) {
1444
+ if (event.code === KeyboardCode.Esc) this.handleCancel();
1445
+ }
1446
+ removeTextSelection() {
1447
+ var _this$document$getSel;
1448
+ (_this$document$getSel = this.document.getSelection()) == null || _this$document$getSel.removeAllRanges();
1449
+ }
1450
+ };
1451
+ var events = {
1452
+ move: { name: "pointermove" },
1453
+ end: { name: "pointerup" }
1454
+ };
1455
+ var PointerSensor = class extends AbstractPointerSensor {
1456
+ constructor(props) {
1457
+ const { event } = props;
1458
+ const listenerTarget = getOwnerDocument(event.target);
1459
+ super(props, events, listenerTarget);
1460
+ }
1461
+ };
1462
+ PointerSensor.activators = [{
1463
+ eventName: "onPointerDown",
1464
+ handler: ({ nativeEvent: event }, { onActivation }) => {
1465
+ if (!event.isPrimary || event.button !== 0) return false;
1466
+ onActivation?.({ event });
1467
+ return true;
1468
+ }
1469
+ }];
1470
+ var events$1 = {
1471
+ move: { name: "mousemove" },
1472
+ end: { name: "mouseup" }
1473
+ };
1474
+ var MouseButton;
1475
+ (function(MouseButton) {
1476
+ MouseButton[MouseButton["RightClick"] = 2] = "RightClick";
1477
+ })(MouseButton || (MouseButton = {}));
1478
+ var MouseSensor = class extends AbstractPointerSensor {
1479
+ constructor(props) {
1480
+ super(props, events$1, getOwnerDocument(props.event.target));
1481
+ }
1482
+ };
1483
+ MouseSensor.activators = [{
1484
+ eventName: "onMouseDown",
1485
+ handler: ({ nativeEvent: event }, { onActivation }) => {
1486
+ if (event.button === MouseButton.RightClick) return false;
1487
+ onActivation?.({ event });
1488
+ return true;
1489
+ }
1490
+ }];
1491
+ var events$2 = {
1492
+ move: { name: "touchmove" },
1493
+ end: { name: "touchend" }
1494
+ };
1495
+ var TouchSensor = class extends AbstractPointerSensor {
1496
+ constructor(props) {
1497
+ super(props, events$2);
1498
+ }
1499
+ static setup() {
1500
+ window.addEventListener(events$2.move.name, noop, {
1501
+ capture: false,
1502
+ passive: false
1503
+ });
1504
+ return function teardown() {
1505
+ window.removeEventListener(events$2.move.name, noop);
1506
+ };
1507
+ function noop() {}
1508
+ }
1509
+ };
1510
+ TouchSensor.activators = [{
1511
+ eventName: "onTouchStart",
1512
+ handler: ({ nativeEvent: event }, { onActivation }) => {
1513
+ const { touches } = event;
1514
+ if (touches.length > 1) return false;
1515
+ onActivation?.({ event });
1516
+ return true;
1517
+ }
1518
+ }];
1519
+ function applyModifiers(modifiers, { transform, ...args }) {
1520
+ return (modifiers == null ? void 0 : modifiers.length) ? modifiers.reduce((accumulator, modifier) => {
1521
+ return modifier({
1522
+ transform: accumulator,
1523
+ ...args
1524
+ });
1525
+ }, transform) : transform;
1526
+ }
1527
+ var defaultSensors = [{
1528
+ sensor: PointerSensor,
1529
+ options: {}
1530
+ }, {
1531
+ sensor: KeyboardSensor,
1532
+ options: {}
1533
+ }];
1534
+ var defaultData = { current: {} };
1535
+ var ActiveDraggableContext = /* @__PURE__ */ (0, import_react.createContext)({
1536
+ ...defaultCoordinates,
1537
+ scaleX: 1,
1538
+ scaleY: 1
1539
+ });
1540
+ var DndContext = /* @__PURE__ */ (0, import_react.memo)(function DndContext({ id, autoScroll = true, announcements, children, sensors = defaultSensors, collisionDetection = rectIntersection, measuring, modifiers, screenReaderInstructions: screenReaderInstructions$1 = screenReaderInstructions, ...props }) {
1541
+ var _measuring$draggable$, _measuring$draggable, _sensorContext$curren, _dragOverlay$rect, _over$rect;
1542
+ const [state, dispatch] = (0, import_react.useReducer)(reducer, void 0, getInitialState);
1543
+ const [monitorState, setMonitorState] = (0, import_react.useState)(() => ({
1544
+ type: null,
1545
+ event: null
1546
+ }));
1547
+ const [isDragging, setIsDragging] = (0, import_react.useState)(false);
1548
+ const { draggable: { active: activeId, nodes: draggableNodes, translate }, droppable: { containers: droppableContainers } } = state;
1549
+ const node = activeId ? draggableNodes[activeId] : null;
1550
+ const activeRects = (0, import_react.useRef)({
1551
+ initial: null,
1552
+ translated: null
1553
+ });
1554
+ const active = (0, import_react.useMemo)(() => {
1555
+ var _node$data;
1556
+ return activeId != null ? {
1557
+ id: activeId,
1558
+ data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData,
1559
+ rect: activeRects
1560
+ } : null;
1561
+ }, [activeId, node]);
1562
+ const activeRef = (0, import_react.useRef)(null);
1563
+ const [activeSensor, setActiveSensor] = (0, import_react.useState)(null);
1564
+ const [activatorEvent, setActivatorEvent] = (0, import_react.useState)(null);
1565
+ const latestProps = (0, import_react.useRef)(props);
1566
+ const draggableDescribedById = useUniqueId(`DndDescribedBy`, id);
1567
+ const enabledDroppableContainers = (0, import_react.useMemo)(() => {
1568
+ return droppableContainers.getEnabled();
1569
+ }, [droppableContainers]);
1570
+ const { layoutRectMap: droppableRects, recomputeLayouts, willRecomputeLayouts } = useDroppableMeasuring(enabledDroppableContainers, {
1571
+ dragging: isDragging,
1572
+ dependencies: [translate.x, translate.y],
1573
+ config: measuring == null ? void 0 : measuring.droppable
1574
+ });
1575
+ const activeNode = useCachedNode(draggableNodes, activeId);
1576
+ const activationCoordinates = activatorEvent ? getEventCoordinates(activatorEvent) : null;
1577
+ const activeNodeRect = useRect(activeNode, (_measuring$draggable$ = measuring == null ? void 0 : (_measuring$draggable = measuring.draggable) == null ? void 0 : _measuring$draggable.measure) != null ? _measuring$draggable$ : getViewRect);
1578
+ const activeNodeClientRect = useClientRect(activeNode);
1579
+ const initialActiveNodeRectRef = (0, import_react.useRef)(null);
1580
+ const initialActiveNodeRect = initialActiveNodeRectRef.current;
1581
+ const sensorContext = (0, import_react.useRef)({
1582
+ active: null,
1583
+ activeNode,
1584
+ collisionRect: null,
1585
+ droppableRects,
1586
+ draggableNodes,
1587
+ draggingNodeRect: null,
1588
+ droppableContainers,
1589
+ over: null,
1590
+ scrollableAncestors: [],
1591
+ scrollAdjustedTranslate: null,
1592
+ translatedRect: null
1593
+ });
1594
+ const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id);
1595
+ const windowRect = useClientRect(activeNode ? activeNode.ownerDocument.defaultView : null);
1596
+ const containerNodeRect = useClientRect(activeNode ? activeNode.parentElement : null);
1597
+ const scrollableAncestors = useScrollableAncestors(activeId ? overNode != null ? overNode : activeNode : null);
1598
+ const scrollableAncestorRects = useClientRects(scrollableAncestors);
1599
+ const dragOverlay = useDragOverlayMeasuring({
1600
+ disabled: activeId == null,
1601
+ forceRecompute: willRecomputeLayouts
1602
+ });
1603
+ const draggingNodeRect = (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect;
1604
+ const nodeRectDelta = draggingNodeRect === activeNodeRect ? getRectDelta(activeNodeRect, initialActiveNodeRect) : defaultCoordinates;
1605
+ const modifiedTranslate = applyModifiers(modifiers, {
1606
+ transform: {
1607
+ x: translate.x - nodeRectDelta.x,
1608
+ y: translate.y - nodeRectDelta.y,
1609
+ scaleX: 1,
1610
+ scaleY: 1
1611
+ },
1612
+ activatorEvent,
1613
+ active,
1614
+ activeNodeRect: activeNodeClientRect,
1615
+ containerNodeRect,
1616
+ draggingNodeRect,
1617
+ over: sensorContext.current.over,
1618
+ overlayNodeRect: dragOverlay.rect,
1619
+ scrollableAncestors,
1620
+ scrollableAncestorRects,
1621
+ windowRect
1622
+ });
1623
+ const pointerCoordinates = activationCoordinates ? add(activationCoordinates, translate) : null;
1624
+ const scrollAdjustment = useScrollOffsets(scrollableAncestors);
1625
+ const scrollAdjustedTranslate = add(modifiedTranslate, scrollAdjustment);
1626
+ const translatedRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null;
1627
+ const collisionRect = translatedRect ? getAdjustedRect(translatedRect, scrollAdjustment) : null;
1628
+ const overId = active && collisionRect ? collisionDetection({
1629
+ active,
1630
+ collisionRect,
1631
+ droppableContainers: enabledDroppableContainers
1632
+ }) : null;
1633
+ const [over, setOver] = (0, import_react.useState)(null);
1634
+ const transform = adjustScale(modifiedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect);
1635
+ const instantiateSensor = (0, import_react.useCallback)((event, { sensor: Sensor, options }) => {
1636
+ if (!activeRef.current) return;
1637
+ const activeNode = draggableNodes[activeRef.current];
1638
+ if (!activeNode) return;
1639
+ const sensorInstance = new Sensor({
1640
+ active: activeRef.current,
1641
+ activeNode,
1642
+ event: event.nativeEvent,
1643
+ options,
1644
+ context: sensorContext,
1645
+ onStart(initialCoordinates) {
1646
+ const id = activeRef.current;
1647
+ if (!id) return;
1648
+ const node = draggableNodes[id];
1649
+ if (!node) return;
1650
+ const { onDragStart } = latestProps.current;
1651
+ const event = { active: {
1652
+ id,
1653
+ data: node.data,
1654
+ rect: activeRects
1655
+ } };
1656
+ (0, import_react_dom.unstable_batchedUpdates)(() => {
1657
+ dispatch({
1658
+ type: Action.DragStart,
1659
+ initialCoordinates,
1660
+ active: id
1661
+ });
1662
+ setMonitorState({
1663
+ type: Action.DragStart,
1664
+ event
1665
+ });
1666
+ });
1667
+ onDragStart?.(event);
1668
+ },
1669
+ onMove(coordinates) {
1670
+ dispatch({
1671
+ type: Action.DragMove,
1672
+ coordinates
1673
+ });
1674
+ },
1675
+ onEnd: createHandler(Action.DragEnd),
1676
+ onCancel: createHandler(Action.DragCancel)
1677
+ });
1678
+ (0, import_react_dom.unstable_batchedUpdates)(() => {
1679
+ setActiveSensor(sensorInstance);
1680
+ setActivatorEvent(event.nativeEvent);
1681
+ });
1682
+ function createHandler(type) {
1683
+ return async function handler() {
1684
+ const { active, over, scrollAdjustedTranslate } = sensorContext.current;
1685
+ let event = null;
1686
+ if (active && scrollAdjustedTranslate) {
1687
+ const { cancelDrop } = latestProps.current;
1688
+ event = {
1689
+ active,
1690
+ delta: scrollAdjustedTranslate,
1691
+ over
1692
+ };
1693
+ if (type === Action.DragEnd && typeof cancelDrop === "function") {
1694
+ if (await Promise.resolve(cancelDrop(event))) type = Action.DragCancel;
1695
+ }
1696
+ }
1697
+ activeRef.current = null;
1698
+ (0, import_react_dom.unstable_batchedUpdates)(() => {
1699
+ dispatch({ type });
1700
+ setOver(null);
1701
+ setIsDragging(false);
1702
+ setActiveSensor(null);
1703
+ setActivatorEvent(null);
1704
+ if (event) setMonitorState({
1705
+ type,
1706
+ event
1707
+ });
1708
+ });
1709
+ if (event) {
1710
+ const { onDragCancel, onDragEnd } = latestProps.current;
1711
+ (type === Action.DragEnd ? onDragEnd : onDragCancel)?.(event);
1712
+ }
1713
+ };
1714
+ }
1715
+ }, [dispatch, draggableNodes]);
1716
+ const activators = useCombineActivators(sensors, (0, import_react.useCallback)((handler, sensor) => {
1717
+ return (event, active) => {
1718
+ const nativeEvent = event.nativeEvent;
1719
+ if (activeRef.current !== null || nativeEvent.dndKit || nativeEvent.defaultPrevented) return;
1720
+ if (handler(event, sensor.options) === true) {
1721
+ nativeEvent.dndKit = { capturedBy: sensor.sensor };
1722
+ activeRef.current = active;
1723
+ instantiateSensor(event, sensor);
1724
+ }
1725
+ };
1726
+ }, [instantiateSensor]));
1727
+ useSensorSetup(sensors);
1728
+ useIsomorphicLayoutEffect(() => {
1729
+ latestProps.current = props;
1730
+ }, Object.values(props));
1731
+ (0, import_react.useEffect)(() => {
1732
+ if (activeId != null) setIsDragging(true);
1733
+ }, [activeId]);
1734
+ (0, import_react.useEffect)(() => {
1735
+ if (!active) initialActiveNodeRectRef.current = null;
1736
+ if (active && activeNodeRect && !initialActiveNodeRectRef.current) initialActiveNodeRectRef.current = activeNodeRect;
1737
+ }, [activeNodeRect, active]);
1738
+ (0, import_react.useEffect)(() => {
1739
+ const { onDragMove } = latestProps.current;
1740
+ const { active, over } = sensorContext.current;
1741
+ if (!active) return;
1742
+ const event = {
1743
+ active,
1744
+ delta: {
1745
+ x: scrollAdjustedTranslate.x,
1746
+ y: scrollAdjustedTranslate.y
1747
+ },
1748
+ over
1749
+ };
1750
+ setMonitorState({
1751
+ type: Action.DragMove,
1752
+ event
1753
+ });
1754
+ onDragMove?.(event);
1755
+ }, [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]);
1756
+ (0, import_react.useEffect)(() => {
1757
+ const { active, droppableContainers, scrollAdjustedTranslate } = sensorContext.current;
1758
+ if (!active || !activeRef.current || !scrollAdjustedTranslate) return;
1759
+ const { onDragOver } = latestProps.current;
1760
+ const overContainer = droppableContainers.get(overId);
1761
+ const over = overContainer && overContainer.rect.current ? {
1762
+ id: overContainer.id,
1763
+ rect: overContainer.rect.current,
1764
+ data: overContainer.data,
1765
+ disabled: overContainer.disabled
1766
+ } : null;
1767
+ const event = {
1768
+ active,
1769
+ delta: {
1770
+ x: scrollAdjustedTranslate.x,
1771
+ y: scrollAdjustedTranslate.y
1772
+ },
1773
+ over
1774
+ };
1775
+ (0, import_react_dom.unstable_batchedUpdates)(() => {
1776
+ setOver(over);
1777
+ setMonitorState({
1778
+ type: Action.DragOver,
1779
+ event
1780
+ });
1781
+ onDragOver?.(event);
1782
+ });
1783
+ }, [overId]);
1784
+ useIsomorphicLayoutEffect(() => {
1785
+ sensorContext.current = {
1786
+ active,
1787
+ activeNode,
1788
+ collisionRect,
1789
+ droppableRects,
1790
+ draggableNodes,
1791
+ draggingNodeRect,
1792
+ droppableContainers,
1793
+ over,
1794
+ scrollableAncestors,
1795
+ scrollAdjustedTranslate,
1796
+ translatedRect
1797
+ };
1798
+ activeRects.current = {
1799
+ initial: draggingNodeRect,
1800
+ translated: translatedRect
1801
+ };
1802
+ }, [
1803
+ active,
1804
+ activeNode,
1805
+ collisionRect,
1806
+ draggableNodes,
1807
+ draggingNodeRect,
1808
+ droppableRects,
1809
+ droppableContainers,
1810
+ over,
1811
+ scrollableAncestors,
1812
+ scrollAdjustedTranslate,
1813
+ translatedRect
1814
+ ]);
1815
+ useAutoScroller({
1816
+ ...getAutoScrollerOptions(),
1817
+ draggingRect: translatedRect,
1818
+ pointerCoordinates,
1819
+ scrollableAncestors,
1820
+ scrollableAncestorRects
1821
+ });
1822
+ const contextValue = (0, import_react.useMemo)(() => {
1823
+ return {
1824
+ active,
1825
+ activeNode,
1826
+ activeNodeRect,
1827
+ activeNodeClientRect,
1828
+ activatorEvent,
1829
+ activators,
1830
+ ariaDescribedById: { draggable: draggableDescribedById },
1831
+ containerNodeRect,
1832
+ dispatch,
1833
+ dragOverlay,
1834
+ draggableNodes,
1835
+ droppableContainers,
1836
+ droppableRects,
1837
+ over,
1838
+ recomputeLayouts,
1839
+ scrollableAncestors,
1840
+ scrollableAncestorRects,
1841
+ willRecomputeLayouts,
1842
+ windowRect
1843
+ };
1844
+ }, [
1845
+ active,
1846
+ activeNode,
1847
+ activeNodeClientRect,
1848
+ activeNodeRect,
1849
+ activatorEvent,
1850
+ activators,
1851
+ containerNodeRect,
1852
+ dragOverlay,
1853
+ dispatch,
1854
+ draggableNodes,
1855
+ draggableDescribedById,
1856
+ droppableContainers,
1857
+ droppableRects,
1858
+ over,
1859
+ recomputeLayouts,
1860
+ scrollableAncestors,
1861
+ scrollableAncestorRects,
1862
+ willRecomputeLayouts,
1863
+ windowRect
1864
+ ]);
1865
+ return import_react.createElement(DndMonitorContext.Provider, { value: monitorState }, import_react.createElement(Context$1.Provider, { value: contextValue }, import_react.createElement(ActiveDraggableContext.Provider, { value: transform }, children)), import_react.createElement(Accessibility, {
1866
+ announcements,
1867
+ hiddenTextDescribedById: draggableDescribedById,
1868
+ screenReaderInstructions: screenReaderInstructions$1
1869
+ }));
1870
+ function getAutoScrollerOptions() {
1871
+ const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false;
1872
+ const autoScrollGloballyDisabled = typeof autoScroll === "object" ? autoScroll.enabled === false : autoScroll === false;
1873
+ const enabled = !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled;
1874
+ if (typeof autoScroll === "object") return {
1875
+ ...autoScroll,
1876
+ enabled
1877
+ };
1878
+ return { enabled };
1879
+ }
1880
+ });
1881
+ var NullContext = /* @__PURE__ */ (0, import_react.createContext)(null);
1882
+ var defaultRole = "button";
1883
+ var ID_PREFIX$1 = "Droppable";
1884
+ function useDraggable({ id, data, disabled = false, attributes }) {
1885
+ const key = useUniqueId(ID_PREFIX$1);
1886
+ const { active, activeNodeRect, activatorEvent, ariaDescribedById, draggableNodes, droppableRects, activators, over } = (0, import_react.useContext)(Context$1);
1887
+ const { role = defaultRole, roleDescription = "draggable", tabIndex = 0 } = attributes != null ? attributes : {};
1888
+ const isDragging = (active == null ? void 0 : active.id) === id;
1889
+ const transform = (0, import_react.useContext)(isDragging ? ActiveDraggableContext : NullContext);
1890
+ const [node, setNodeRef] = useNodeRef();
1891
+ const listeners = useSyntheticListeners(activators, id);
1892
+ const dataRef = useData(data);
1893
+ (0, import_react.useEffect)(() => {
1894
+ draggableNodes[id] = {
1895
+ id,
1896
+ key,
1897
+ node,
1898
+ data: dataRef
1899
+ };
1900
+ return () => {
1901
+ const node = draggableNodes[id];
1902
+ if (node && node.key === key) delete draggableNodes[id];
1903
+ };
1904
+ }, [draggableNodes, id]);
1905
+ return {
1906
+ active,
1907
+ activeNodeRect,
1908
+ activatorEvent,
1909
+ attributes: (0, import_react.useMemo)(() => ({
1910
+ role,
1911
+ tabIndex,
1912
+ "aria-pressed": isDragging && role === defaultRole ? true : void 0,
1913
+ "aria-roledescription": roleDescription,
1914
+ "aria-describedby": ariaDescribedById.draggable
1915
+ }), [
1916
+ role,
1917
+ tabIndex,
1918
+ isDragging,
1919
+ roleDescription,
1920
+ ariaDescribedById.draggable
1921
+ ]),
1922
+ droppableRects,
1923
+ isDragging,
1924
+ listeners: disabled ? void 0 : listeners,
1925
+ node,
1926
+ over,
1927
+ setNodeRef,
1928
+ transform
1929
+ };
1930
+ }
1931
+ function useDndContext() {
1932
+ return (0, import_react.useContext)(Context$1);
1933
+ }
1934
+ var ID_PREFIX$1$1 = "Droppable";
1935
+ function useDroppable({ data, disabled = false, id }) {
1936
+ const key = useUniqueId(ID_PREFIX$1$1);
1937
+ const { active, dispatch, over } = (0, import_react.useContext)(Context$1);
1938
+ const rect = (0, import_react.useRef)(null);
1939
+ const [nodeRef, setNodeRef] = useNodeRef();
1940
+ const dataRef = useData(data);
1941
+ useIsomorphicLayoutEffect(() => {
1942
+ dispatch({
1943
+ type: Action.RegisterDroppable,
1944
+ element: {
1945
+ id,
1946
+ key,
1947
+ disabled,
1948
+ node: nodeRef,
1949
+ rect,
1950
+ data: dataRef
1951
+ }
1952
+ });
1953
+ return () => dispatch({
1954
+ type: Action.UnregisterDroppable,
1955
+ key,
1956
+ id
1957
+ });
1958
+ }, [id]);
1959
+ (0, import_react.useEffect)(() => {
1960
+ dispatch({
1961
+ type: Action.SetDroppableDisabled,
1962
+ id,
1963
+ key,
1964
+ disabled
1965
+ });
1966
+ }, [disabled]);
1967
+ return {
1968
+ active,
1969
+ rect,
1970
+ isOver: (over == null ? void 0 : over.id) === id,
1971
+ node: nodeRef,
1972
+ over,
1973
+ setNodeRef
1974
+ };
1975
+ }
1976
+ //#endregion
1977
+ //#region ../../node_modules/.pnpm/@dnd-kit+sortable@5.1.0_@dnd-kit+core@4.0.3_react-dom@19.2.4_react@19.2.4__react@19.2.4__react@19.2.4/node_modules/@dnd-kit/sortable/dist/sortable.esm.js
1978
+ /**
1979
+ * Move an array item to a different position. Returns a new array with the item moved to the new position.
1980
+ */
1981
+ function arrayMove(array, from, to) {
1982
+ const newArray = array.slice();
1983
+ newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
1984
+ return newArray;
1985
+ }
1986
+ function getSortedRects(items, layoutRects) {
1987
+ return items.reduce((accumulator, id, index) => {
1988
+ const layoutRect = layoutRects.get(id);
1989
+ if (layoutRect) accumulator[index] = layoutRect;
1990
+ return accumulator;
1991
+ }, Array(items.length));
1992
+ }
1993
+ function isValidIndex(index) {
1994
+ return index !== null && index >= 0;
1995
+ }
1996
+ var rectSortingStrategy = ({ layoutRects, activeIndex, overIndex, index }) => {
1997
+ const newRects = arrayMove(layoutRects, overIndex, activeIndex);
1998
+ const oldRect = layoutRects[index];
1999
+ const newRect = newRects[index];
2000
+ if (!newRect || !oldRect) return null;
2001
+ return {
2002
+ x: newRect.offsetLeft - oldRect.offsetLeft,
2003
+ y: newRect.offsetTop - oldRect.offsetTop,
2004
+ scaleX: newRect.width / oldRect.width,
2005
+ scaleY: newRect.height / oldRect.height
2006
+ };
2007
+ };
2008
+ var ID_PREFIX = "Sortable";
2009
+ var Context = /* @__PURE__ */ import_react.createContext({
2010
+ activeIndex: -1,
2011
+ containerId: ID_PREFIX,
2012
+ disableTransforms: false,
2013
+ items: [],
2014
+ overIndex: -1,
2015
+ useDragOverlay: false,
2016
+ sortedRects: [],
2017
+ strategy: rectSortingStrategy,
2018
+ wasDragging: { current: false }
2019
+ });
2020
+ function SortableContext({ children, id, items: userDefinedItems, strategy = rectSortingStrategy }) {
2021
+ const { active, dragOverlay, droppableRects, over, recomputeLayouts, willRecomputeLayouts } = useDndContext();
2022
+ const containerId = useUniqueId(ID_PREFIX, id);
2023
+ const useDragOverlay = Boolean(dragOverlay.rect !== null);
2024
+ const items = (0, import_react.useMemo)(() => userDefinedItems.map((item) => typeof item === "string" ? item : item.id), [userDefinedItems]);
2025
+ const isDragging = active != null;
2026
+ const wasDragging = (0, import_react.useRef)(false);
2027
+ const activeIndex = active ? items.indexOf(active.id) : -1;
2028
+ const isSorting = activeIndex !== -1;
2029
+ const overIndex = over ? items.indexOf(over.id) : -1;
2030
+ const previousItemsRef = (0, import_react.useRef)(items);
2031
+ const sortedRects = getSortedRects(items, droppableRects);
2032
+ const itemsHaveChanged = !isEqual(items, previousItemsRef.current);
2033
+ const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
2034
+ useIsomorphicLayoutEffect(() => {
2035
+ if (itemsHaveChanged && isSorting && !willRecomputeLayouts) recomputeLayouts();
2036
+ }, [
2037
+ itemsHaveChanged,
2038
+ isSorting,
2039
+ recomputeLayouts,
2040
+ willRecomputeLayouts
2041
+ ]);
2042
+ (0, import_react.useEffect)(() => {
2043
+ previousItemsRef.current = items;
2044
+ }, [items]);
2045
+ (0, import_react.useEffect)(() => {
2046
+ const timeoutId = setTimeout(() => {
2047
+ wasDragging.current = isDragging;
2048
+ }, 100);
2049
+ return () => clearTimeout(timeoutId);
2050
+ }, [isDragging]);
2051
+ const contextValue = (0, import_react.useMemo)(() => ({
2052
+ activeIndex,
2053
+ containerId,
2054
+ disableTransforms,
2055
+ items,
2056
+ overIndex,
2057
+ useDragOverlay,
2058
+ sortedRects,
2059
+ strategy,
2060
+ wasDragging
2061
+ }), [
2062
+ activeIndex,
2063
+ containerId,
2064
+ disableTransforms,
2065
+ items,
2066
+ overIndex,
2067
+ sortedRects,
2068
+ useDragOverlay,
2069
+ strategy,
2070
+ wasDragging
2071
+ ]);
2072
+ return import_react.createElement(Context.Provider, { value: contextValue }, children);
2073
+ }
2074
+ function isEqual(arr1, arr2) {
2075
+ return arr1.join() === arr2.join();
2076
+ }
2077
+ var defaultNewIndexGetter = ({ id, items, activeIndex, overIndex }) => arrayMove(items, activeIndex, overIndex).indexOf(id);
2078
+ var defaultAnimateLayoutChanges = ({ containerId, isSorting, wasDragging, index, items, newIndex, previousItems, previousContainerId, transition }) => {
2079
+ if (!transition || !wasDragging) return false;
2080
+ if (previousItems !== items && index === newIndex) return false;
2081
+ if (isSorting) return true;
2082
+ return newIndex !== index && containerId === previousContainerId;
2083
+ };
2084
+ var defaultTransition = {
2085
+ duration: 200,
2086
+ easing: "ease"
2087
+ };
2088
+ var transitionProperty = "transform";
2089
+ var disabledTransition = /* @__PURE__ */ CSS.Transition.toString({
2090
+ property: transitionProperty,
2091
+ duration: 0,
2092
+ easing: "linear"
2093
+ });
2094
+ var defaultAttributes = { roleDescription: "sortable" };
2095
+ function useDerivedTransform({ disabled, index, node, rect }) {
2096
+ const [derivedTransform, setDerivedtransform] = (0, import_react.useState)(null);
2097
+ const previousIndex = (0, import_react.useRef)(index);
2098
+ useIsomorphicLayoutEffect(() => {
2099
+ if (!disabled && index !== previousIndex.current && node.current) {
2100
+ const initial = rect.current;
2101
+ if (initial) {
2102
+ const current = getBoundingClientRect(node.current);
2103
+ const delta = {
2104
+ x: initial.offsetLeft - current.offsetLeft,
2105
+ y: initial.offsetTop - current.offsetTop,
2106
+ scaleX: initial.width / current.width,
2107
+ scaleY: initial.height / current.height
2108
+ };
2109
+ if (delta.x || delta.y) setDerivedtransform(delta);
2110
+ }
2111
+ }
2112
+ if (index !== previousIndex.current) previousIndex.current = index;
2113
+ }, [
2114
+ disabled,
2115
+ index,
2116
+ node,
2117
+ rect
2118
+ ]);
2119
+ (0, import_react.useEffect)(() => {
2120
+ if (derivedTransform) requestAnimationFrame(() => {
2121
+ setDerivedtransform(null);
2122
+ });
2123
+ }, [derivedTransform]);
2124
+ return derivedTransform;
2125
+ }
2126
+ function useSortable({ animateLayoutChanges = defaultAnimateLayoutChanges, attributes: userDefinedAttributes, disabled, data: customData, getNewIndex = defaultNewIndexGetter, id, strategy: localStrategy, transition = defaultTransition }) {
2127
+ const { items, containerId, activeIndex, disableTransforms, sortedRects, overIndex, useDragOverlay, strategy: globalStrategy, wasDragging } = (0, import_react.useContext)(Context);
2128
+ const index = items.indexOf(id);
2129
+ const data = (0, import_react.useMemo)(() => ({
2130
+ sortable: {
2131
+ containerId,
2132
+ index,
2133
+ items
2134
+ },
2135
+ ...customData
2136
+ }), [
2137
+ containerId,
2138
+ customData,
2139
+ index,
2140
+ items
2141
+ ]);
2142
+ const { rect, node, setNodeRef: setDroppableNodeRef } = useDroppable({
2143
+ id,
2144
+ data
2145
+ });
2146
+ const { active, activeNodeRect, activatorEvent, attributes, setNodeRef: setDraggableNodeRef, listeners, isDragging, over, transform } = useDraggable({
2147
+ id,
2148
+ data,
2149
+ attributes: {
2150
+ ...defaultAttributes,
2151
+ ...userDefinedAttributes
2152
+ },
2153
+ disabled
2154
+ });
2155
+ const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
2156
+ const isSorting = Boolean(active);
2157
+ const displaceItem = isSorting && wasDragging.current && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
2158
+ const shouldDisplaceDragSource = !useDragOverlay && isDragging;
2159
+ const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
2160
+ const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : (localStrategy != null ? localStrategy : globalStrategy)({
2161
+ layoutRects: sortedRects,
2162
+ activeNodeRect,
2163
+ activeIndex,
2164
+ overIndex,
2165
+ index
2166
+ }) : null;
2167
+ const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
2168
+ id,
2169
+ items,
2170
+ activeIndex,
2171
+ overIndex
2172
+ }) : index;
2173
+ const prevItems = (0, import_react.useRef)(items);
2174
+ const itemsHaveChanged = items !== prevItems.current;
2175
+ const prevNewIndex = (0, import_react.useRef)(newIndex);
2176
+ const previousContainerId = (0, import_react.useRef)(containerId);
2177
+ const shouldAnimateLayoutChanges = animateLayoutChanges({
2178
+ active,
2179
+ containerId,
2180
+ isDragging,
2181
+ isSorting,
2182
+ id,
2183
+ index,
2184
+ items,
2185
+ newIndex: prevNewIndex.current,
2186
+ previousItems: prevItems.current,
2187
+ previousContainerId: previousContainerId.current,
2188
+ transition,
2189
+ wasDragging: wasDragging.current
2190
+ });
2191
+ const derivedTransform = useDerivedTransform({
2192
+ disabled: !shouldAnimateLayoutChanges,
2193
+ index,
2194
+ node,
2195
+ rect
2196
+ });
2197
+ (0, import_react.useEffect)(() => {
2198
+ if (isSorting && prevNewIndex.current !== newIndex) prevNewIndex.current = newIndex;
2199
+ if (containerId !== previousContainerId.current) previousContainerId.current = containerId;
2200
+ if (items !== prevItems.current) prevItems.current = items;
2201
+ }, [
2202
+ isSorting,
2203
+ newIndex,
2204
+ containerId,
2205
+ items
2206
+ ]);
2207
+ return {
2208
+ active,
2209
+ attributes,
2210
+ activatorEvent,
2211
+ rect,
2212
+ index,
2213
+ isSorting,
2214
+ isDragging,
2215
+ listeners,
2216
+ node,
2217
+ overIndex,
2218
+ over,
2219
+ setNodeRef,
2220
+ setDroppableNodeRef,
2221
+ setDraggableNodeRef,
2222
+ transform: derivedTransform != null ? derivedTransform : finalTransform,
2223
+ transition: getTransition()
2224
+ };
2225
+ function getTransition() {
2226
+ if (derivedTransform || itemsHaveChanged && prevNewIndex.current === index) return disabledTransition;
2227
+ if (shouldDisplaceDragSource || !transition) return;
2228
+ if (isSorting || shouldAnimateLayoutChanges) return CSS.Transition.toString({
2229
+ ...transition,
2230
+ property: transitionProperty
2231
+ });
2232
+ }
2233
+ }
2234
+ KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left;
2235
+ //#endregion
2236
+ //#region ~icons/lucide/gauge.jsx
2237
+ var import_jsx_runtime = require_jsx_runtime();
2238
+ var lucideGauge = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
2239
+ viewBox: "0 0 24 24",
2240
+ width: "1.2em",
2241
+ height: "1.2em",
2242
+ ...props,
2243
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
2244
+ fill: "none",
2245
+ stroke: "currentColor",
2246
+ strokeLinecap: "round",
2247
+ strokeLinejoin: "round",
2248
+ strokeWidth: 2,
2249
+ d: "m12 14l4-4M3.34 19a10 10 0 1 1 17.32 0"
2250
+ })
2251
+ });
2252
+ //#endregion
2253
+ //#region ~icons/lucide/grip-vertical.jsx
2254
+ var lucideGripVertical = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
2255
+ viewBox: "0 0 24 24",
2256
+ width: "1.2em",
2257
+ height: "1.2em",
2258
+ ...props,
2259
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", {
2260
+ fill: "none",
2261
+ stroke: "currentColor",
2262
+ strokeLinecap: "round",
2263
+ strokeLinejoin: "round",
2264
+ strokeWidth: 2,
2265
+ children: [
2266
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
2267
+ cx: 9,
2268
+ cy: 12,
2269
+ r: 1
2270
+ }),
2271
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
2272
+ cx: 9,
2273
+ cy: 5,
2274
+ r: 1
2275
+ }),
2276
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
2277
+ cx: 9,
2278
+ cy: 19,
2279
+ r: 1
2280
+ }),
2281
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
2282
+ cx: 15,
2283
+ cy: 12,
2284
+ r: 1
2285
+ }),
2286
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
2287
+ cx: 15,
2288
+ cy: 5,
2289
+ r: 1
2290
+ }),
2291
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
2292
+ cx: 15,
2293
+ cy: 19,
2294
+ r: 1
2295
+ })
2296
+ ]
2297
+ })
2298
+ });
2299
+ //#endregion
2300
+ //#region src/components/qgrid/UsageCard.tsx
2301
+ var QUOTA_THRESHOLD_PROVIDERS = new Set(["anthropic", "openai"]);
2302
+ function validateThreshold(raw) {
2303
+ const trimmed = raw.trim();
2304
+ if (trimmed === "") return {
2305
+ ok: true,
2306
+ value: null
2307
+ };
2308
+ if (!/^\d+$/.test(trimmed)) return {
2309
+ ok: false,
2310
+ error: "정수만 입력하세요 (0–100)"
2311
+ };
2312
+ const n = Number(trimmed);
2313
+ if (n > 100) return {
2314
+ ok: false,
2315
+ error: "100 이하여야 합니다"
2316
+ };
2317
+ return {
2318
+ ok: true,
2319
+ value: n === 0 ? null : n
2320
+ };
2321
+ }
2322
+ function validateWeight(raw) {
2323
+ const trimmed = raw.trim();
2324
+ if (!/^\d+$/.test(trimmed)) return {
2325
+ ok: false,
2326
+ error: "1–100 사이 정수를 입력하세요"
2327
+ };
2328
+ const value = Number(trimmed);
2329
+ if (value < 1 || value > 100) return {
2330
+ ok: false,
2331
+ error: "1–100 사이 정수를 입력하세요"
2332
+ };
2333
+ return {
2334
+ ok: true,
2335
+ value
2336
+ };
2337
+ }
2338
+ var PROVIDER_THEMES = {
2339
+ openai: {
2340
+ stripe: "bg-openai-400",
2341
+ bar: "bg-openai-bar",
2342
+ badge: "bg-openai-50 text-openai-600",
2343
+ cost: "text-openai-600"
2344
+ },
2345
+ anthropic: {
2346
+ stripe: "bg-anthropic-400",
2347
+ bar: "bg-anthropic-400",
2348
+ badge: "bg-anthropic-50 text-anthropic-600",
2349
+ cost: "text-anthropic-600"
2350
+ },
2351
+ google: {
2352
+ stripe: "bg-google-400",
2353
+ bar: "bg-google-400",
2354
+ badge: "bg-google-50 text-google-600",
2355
+ cost: "text-google-600"
2356
+ }
2357
+ };
2358
+ var DEFAULT_THEME = {
2359
+ stripe: "bg-sand-400",
2360
+ bar: "bg-sienna-400",
2361
+ badge: "bg-sand-200 text-sand-500",
2362
+ cost: "text-sienna-600"
2363
+ };
2364
+ function getProviderTheme(provider) {
2365
+ return PROVIDER_THEMES[provider] ?? DEFAULT_THEME;
2366
+ }
2367
+ function barColor(pct, theme) {
2368
+ if (pct >= 95) return "bg-danger-400";
2369
+ if (pct >= 80) return "bg-caution-400";
2370
+ return theme.bar;
2371
+ }
2372
+ function formatResets(iso) {
2373
+ if (!iso) return "";
2374
+ const diff = new Date(iso).getTime() - Date.now();
2375
+ if (diff <= 0) return "resetting...";
2376
+ const h = Math.floor(diff / 36e5);
2377
+ const m = Math.floor(diff % 36e5 / 6e4);
2378
+ return h > 0 ? `resets ${h}h ${m}m` : `resets ${m}m`;
2379
+ }
2380
+ function formatWindowLabel(fallback, windowDurationMins) {
2381
+ if (!windowDurationMins || windowDurationMins <= 0) return fallback;
2382
+ const hours = windowDurationMins / 60;
2383
+ if (hours >= 24) return `${Math.round(hours / 24)}d`;
2384
+ return `${Math.round(hours)}h`;
2385
+ }
2386
+ function UsageRow({ label, utilization, resetsAt, windowDurationMins, theme, threshold }) {
2387
+ const pct = utilization ?? 0;
2388
+ const hasThreshold = threshold !== void 0 && threshold !== null;
2389
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2390
+ className: "flex items-center gap-2",
2391
+ children: [
2392
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2393
+ className: "text-xs text-sand-600 w-7 shrink-0",
2394
+ children: formatWindowLabel(label, windowDurationMins)
2395
+ }),
2396
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2397
+ className: "relative flex-1 min-w-0 h-2 bg-sand-200 rounded-full overflow-hidden",
2398
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2399
+ className: `h-full rounded-full transition-all duration-300 ${barColor(pct, theme)}`,
2400
+ style: { width: `${Math.min(pct, 100)}%` }
2401
+ }), hasThreshold && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2402
+ className: "absolute top-[-2px] bottom-[-2px] w-0.5 bg-sienna-500 rounded-full",
2403
+ style: { left: `calc(${Math.min(threshold, 100)}% - 1px)` }
2404
+ })]
2405
+ }),
2406
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2407
+ className: "text-xs tabular-nums text-sand-700 w-9 text-right shrink-0",
2408
+ children: [pct, "%"]
2409
+ }),
2410
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2411
+ className: "hidden sm:inline text-[10px] text-sand-400 w-24 text-right shrink-0",
2412
+ title: formatResets(resetsAt),
2413
+ children: formatResets(resetsAt)
2414
+ })
2415
+ ]
2416
+ });
2417
+ }
2418
+ function TokenUsage({ token, theme }) {
2419
+ const { data, isLoading } = QgridService.useUsage(token.id);
2420
+ if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2421
+ className: "animate-pulse space-y-2 py-2",
2422
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 w-full bg-sand-200 rounded-full" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 w-3/4 bg-sand-200 rounded-full" })]
2423
+ });
2424
+ if (data?.error) {
2425
+ const isExpired = data.error.includes("re-login") || data.error.includes("token_revoked") || data.error.includes("401");
2426
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2427
+ className: "py-1",
2428
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2429
+ className: "text-[11px] text-amber-600",
2430
+ children: isExpired ? "Session expired" : "Unavailable"
2431
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2432
+ className: "text-[10px] text-sand-400 mt-0.5",
2433
+ children: isExpired ? "Please re-login via OAuth" : data.error
2434
+ })]
2435
+ });
2436
+ }
2437
+ if (!data?.fiveHour && !data?.sevenDay) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2438
+ className: "text-[11px] text-sand-400 py-1",
2439
+ children: "No usage data"
2440
+ });
2441
+ const thresholdForPrimary = QUOTA_THRESHOLD_PROVIDERS.has(token.provider) ? token.quota_threshold : null;
2442
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2443
+ className: "space-y-1.5 py-1",
2444
+ children: [data.fiveHour && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsageRow, {
2445
+ label: "5h",
2446
+ utilization: data.fiveHour.utilization,
2447
+ resetsAt: data.fiveHour.resetsAt,
2448
+ windowDurationMins: data.fiveHour.windowDurationMins,
2449
+ theme,
2450
+ threshold: thresholdForPrimary
2451
+ }), data.sevenDay && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsageRow, {
2452
+ label: "7d",
2453
+ utilization: data.sevenDay.utilization,
2454
+ resetsAt: data.sevenDay.resetsAt,
2455
+ windowDurationMins: data.sevenDay.windowDurationMins,
2456
+ theme
2457
+ })]
2458
+ });
2459
+ }
2460
+ function ThresholdControl({ token }) {
2461
+ const [pos, setPos] = (0, import_react.useState)(null);
2462
+ const [value, setValue] = (0, import_react.useState)("");
2463
+ const triggerRef = (0, import_react.useRef)(null);
2464
+ const queryClient = useQueryClient();
2465
+ const updateMutation = useUpdateTokenMutation();
2466
+ const supported = QUOTA_THRESHOLD_PROVIDERS.has(token.provider);
2467
+ const open = pos !== null;
2468
+ const validation = validateThreshold(value);
2469
+ const POPOVER_WIDTH = 240;
2470
+ const POPOVER_EST_HEIGHT = 150;
2471
+ const MARGIN = 8;
2472
+ const GAP = 6;
2473
+ const openPopover = () => {
2474
+ const rect = triggerRef.current?.getBoundingClientRect();
2475
+ if (!rect) return;
2476
+ const left = Math.min(Math.max(rect.right - POPOVER_WIDTH, MARGIN), Math.max(window.innerWidth - POPOVER_WIDTH - MARGIN, MARGIN));
2477
+ const above = rect.top - GAP - POPOVER_EST_HEIGHT;
2478
+ const below = rect.bottom + GAP;
2479
+ setPos({
2480
+ left,
2481
+ top: Math.min(Math.max(above >= MARGIN ? above : below, MARGIN), Math.max(window.innerHeight - POPOVER_EST_HEIGHT - MARGIN, MARGIN))
2482
+ });
2483
+ setValue(String(token.quota_threshold ?? 100));
2484
+ };
2485
+ const close = () => setPos(null);
2486
+ if (!supported) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2487
+ className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] text-sand-300 border border-sand-100",
2488
+ title: "Quota threshold는 이 provider에서 지원되지 않습니다",
2489
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideGauge, { className: "size-3" }), "n/a"]
2490
+ });
2491
+ const adjust = (delta) => {
2492
+ const current = /^\d+$/.test(value.trim()) ? Number(value.trim()) : 0;
2493
+ const next = Math.min(Math.max(current + delta, 0), 100);
2494
+ setValue(String(next));
2495
+ };
2496
+ const save = async () => {
2497
+ if (!validation.ok) return;
2498
+ await updateMutation.mutateAsync({
2499
+ id: token.id,
2500
+ quotaThreshold: validation.value
2501
+ });
2502
+ await Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
2503
+ close();
2504
+ };
2505
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2506
+ className: "inline-flex",
2507
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
2508
+ ref: triggerRef,
2509
+ type: "button",
2510
+ title: "사용률 제한 설정",
2511
+ onClick: open ? close : openPopover,
2512
+ className: "flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150",
2513
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideGauge, { className: "size-3" }), "Set limit"]
2514
+ }), open && pos && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2515
+ className: "fixed inset-0 z-40",
2516
+ onPointerDown: close
2517
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2518
+ className: "fixed z-50 w-60 panel shadow-xl p-3",
2519
+ style: {
2520
+ top: pos.top,
2521
+ left: pos.left
2522
+ },
2523
+ children: [
2524
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
2525
+ htmlFor: `threshold-${token.id}`,
2526
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
2527
+ children: "사용률 제한"
2528
+ }),
2529
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2530
+ className: "mt-1 flex items-center gap-2",
2531
+ children: [
2532
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2533
+ type: "button",
2534
+ onClick: () => adjust(-10),
2535
+ className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150",
2536
+ children: "−"
2537
+ }),
2538
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Q, {
2539
+ id: `threshold-${token.id}`,
2540
+ value,
2541
+ onChange: (e) => setValue(e.target.value),
2542
+ inputMode: "numeric",
2543
+ className: `h-9 w-14 border rounded-md text-center text-sm text-sand-900 bg-white tabular-nums focus:outline-none ${validation.ok ? "border-sand-200 focus:border-sienna-300" : "border-red-300 focus:border-red-400"}`
2544
+ }),
2545
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2546
+ type: "button",
2547
+ onClick: () => adjust(10),
2548
+ className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150",
2549
+ children: "+"
2550
+ }),
2551
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2552
+ className: "text-sm text-sand-500",
2553
+ children: "%"
2554
+ })
2555
+ ]
2556
+ }),
2557
+ validation.ok ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2558
+ className: "mt-1.5 text-[11px] text-sand-500 leading-snug",
2559
+ children: validation.value === null ? "제한 없음 — 사용률과 무관하게 항상 사용합니다." : "5h 사용률이 임계치에 달하면 해당 토큰을 건너뜁니다."
2560
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2561
+ className: "mt-1.5 text-[11px] text-red-500",
2562
+ children: validation.error
2563
+ }),
2564
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2565
+ className: "mt-2 flex items-center justify-end gap-1.5",
2566
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2567
+ type: "button",
2568
+ className: "px-2 py-1 text-[11px] font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
2569
+ onClick: close,
2570
+ children: "Cancel"
2571
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2572
+ type: "button",
2573
+ className: "px-2 py-1 text-[11px] font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150",
2574
+ disabled: updateMutation.isPending || !validation.ok,
2575
+ onClick: save,
2576
+ children: updateMutation.isPending ? "Saving..." : "Save"
2577
+ })]
2578
+ })
2579
+ ]
2580
+ })] })]
2581
+ });
2582
+ }
2583
+ function WeightControl({ token }) {
2584
+ const [pos, setPos] = (0, import_react.useState)(null);
2585
+ const [value, setValue] = (0, import_react.useState)("");
2586
+ const triggerRef = (0, import_react.useRef)(null);
2587
+ const queryClient = useQueryClient();
2588
+ const updateMutation = useUpdateTokenMutation();
2589
+ const validation = validateWeight(value);
2590
+ const openPopover = () => {
2591
+ const rect = triggerRef.current?.getBoundingClientRect();
2592
+ if (!rect) return;
2593
+ const width = 240;
2594
+ const height = 150;
2595
+ const margin = 8;
2596
+ const gap = 6;
2597
+ const left = Math.min(Math.max(rect.right - width, margin), Math.max(window.innerWidth - width - margin, margin));
2598
+ const above = rect.top - gap - height;
2599
+ const top = Math.min(Math.max(above >= margin ? above : rect.bottom + gap, margin), Math.max(window.innerHeight - height - margin, margin));
2600
+ setValue(String(token.weight));
2601
+ setPos({
2602
+ left,
2603
+ top
2604
+ });
2605
+ };
2606
+ const close = () => setPos(null);
2607
+ const adjust = (delta) => {
2608
+ const current = /^\d+$/.test(value.trim()) ? Number(value.trim()) : 1;
2609
+ setValue(String(Math.min(Math.max(current + delta, 1), 100)));
2610
+ };
2611
+ const save = async () => {
2612
+ if (!validation.ok) return;
2613
+ await updateMutation.mutateAsync({
2614
+ id: token.id,
2615
+ weight: validation.value
2616
+ });
2617
+ await Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
2618
+ close();
2619
+ };
2620
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2621
+ className: "inline-flex",
2622
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
2623
+ ref: triggerRef,
2624
+ type: "button",
2625
+ title: "라우팅 가중치 설정",
2626
+ onClick: pos ? close : openPopover,
2627
+ className: "flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150",
2628
+ children: ["Weight ", token.weight]
2629
+ }), pos && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2630
+ className: "fixed inset-0 z-40",
2631
+ onPointerDown: close
2632
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2633
+ className: "fixed z-50 w-60 panel shadow-xl p-3",
2634
+ style: pos,
2635
+ children: [
2636
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
2637
+ htmlFor: `weight-${token.id}`,
2638
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
2639
+ children: "라우팅 가중치"
2640
+ }),
2641
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2642
+ className: "mt-1 flex items-center gap-2",
2643
+ children: [
2644
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2645
+ type: "button",
2646
+ onClick: () => adjust(-1),
2647
+ className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600",
2648
+ children: "−"
2649
+ }),
2650
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Q, {
2651
+ id: `weight-${token.id}`,
2652
+ value,
2653
+ onChange: (event) => setValue(event.target.value),
2654
+ inputMode: "numeric",
2655
+ className: `h-9 w-16 border rounded-md text-center text-sm tabular-nums ${validation.ok ? "border-sand-200" : "border-red-300"}`
2656
+ }),
2657
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2658
+ type: "button",
2659
+ onClick: () => adjust(1),
2660
+ className: "size-9 shrink-0 rounded-md border border-sand-200 text-sand-600",
2661
+ children: "+"
2662
+ })
2663
+ ]
2664
+ }),
2665
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2666
+ className: `mt-1.5 text-[11px] ${validation.ok ? "text-sand-500" : "text-red-500"}`,
2667
+ children: validation.ok ? "새 요청의 상대 배정 비율입니다." : validation.error
2668
+ }),
2669
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2670
+ className: "mt-2 flex items-center justify-end gap-1.5",
2671
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2672
+ type: "button",
2673
+ onClick: close,
2674
+ className: "px-2 py-1 text-[11px]",
2675
+ children: "Cancel"
2676
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2677
+ type: "button",
2678
+ onClick: save,
2679
+ disabled: updateMutation.isPending || !validation.ok,
2680
+ className: "px-2 py-1 text-[11px] rounded-md bg-sienna-400 text-white disabled:opacity-50",
2681
+ children: updateMutation.isPending ? "Saving..." : "Save"
2682
+ })]
2683
+ })
2684
+ ]
2685
+ })] })]
2686
+ });
2687
+ }
2688
+ /**
2689
+ * 재로그인의 유일한 진입점.
2690
+ *
2691
+ * 조치가 필요하다는 것을 알게 되는 곳이 만료된 토큰 카드라, 거기서 바로 누를 수 있어야
2692
+ * 한다. Tokens 페이지에도 같은 버튼을 두었더니 같은 일을 두 곳에서 하게 돼 걷어냈다.
2693
+ *
2694
+ * `useOAuthLoginFlow` 는 Add Token 과 공유한다 — 원격 접속이면 코드 입력 단계로 이어지므로
2695
+ * 모달까지 이 컴포넌트가 함께 들고 있다.
2696
+ */
2697
+ function ReloginButton({ token }) {
2698
+ const oauth = useOAuthLoginFlow();
2699
+ const submitCode = async (pastedCode) => {
2700
+ if (await oauth.submitCode(pastedCode)) oauth.reset();
2701
+ };
2702
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2703
+ type: "button",
2704
+ title: "기존 이름으로 다시 로그인",
2705
+ disabled: oauth.loadingProvider !== null,
2706
+ onClick: () => void oauth.start(token.provider, token.name ?? ""),
2707
+ className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium border border-sienna-300 text-sienna-600 hover:bg-sienna-50 disabled:opacity-50 transition-colors duration-150",
2708
+ children: oauth.loadingProvider === token.provider ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "size-2.5 border-2 border-sienna-400 border-t-transparent rounded-full animate-spin" }), "로그인 대기"] }) : "재로그인"
2709
+ }), oauth.codeEntry && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2710
+ className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
2711
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2712
+ className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
2713
+ onClick: oauth.reset,
2714
+ onKeyDown: () => {}
2715
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2716
+ className: "relative panel shadow-xl w-full max-w-md mx-4",
2717
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2718
+ className: "px-5 py-4 border-b border-sand-100/60",
2719
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
2720
+ className: "text-base font-medium text-sand-900",
2721
+ children: "재로그인"
2722
+ })
2723
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2724
+ className: "px-5 py-4",
2725
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OAuthCodeEntry, {
2726
+ isPending: oauth.completeMutation.isPending,
2727
+ isError: oauth.completeMutation.isError,
2728
+ onSubmit: (code) => void submitCode(code),
2729
+ onRestart: oauth.reset
2730
+ })
2731
+ })]
2732
+ })]
2733
+ })] });
2734
+ }
2735
+ function SortableTokenCard({ token }) {
2736
+ const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
2737
+ id: String(token.id),
2738
+ transition: {
2739
+ duration: 200,
2740
+ easing: "ease"
2741
+ }
2742
+ });
2743
+ const { data: costData } = QgridService.useTotalCost({
2744
+ num: 0,
2745
+ page: 1,
2746
+ ...token.name ? { token_name: token.name } : {}
2747
+ }, { enabled: !!token.name });
2748
+ const theme = getProviderTheme(token.provider);
2749
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2750
+ ref: setNodeRef,
2751
+ style: {
2752
+ transform: CSS.Translate.toString(transform),
2753
+ transition,
2754
+ opacity: isDragging ? .5 : 1,
2755
+ zIndex: isDragging ? 10 : void 0
2756
+ },
2757
+ className: "relative rounded-lg bg-white border border-sand-200/80 overflow-hidden shadow-sm hover:shadow-md transition-shadow duration-200",
2758
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `absolute inset-y-0 left-0 w-1 ${theme.stripe}` }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2759
+ className: "pl-4 pr-3 py-3",
2760
+ children: [
2761
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2762
+ className: "flex items-start justify-between gap-2 mb-2",
2763
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2764
+ className: "flex items-center gap-1.5 min-w-0",
2765
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2766
+ type: "button",
2767
+ "aria-label": "순서 변경 핸들",
2768
+ ...attributes,
2769
+ ...listeners,
2770
+ className: "shrink-0 -m-1 p-1 text-sand-300 hover:text-sand-500 cursor-grab active:cursor-grabbing touch-none",
2771
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideGripVertical, { className: "size-3.5" })
2772
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2773
+ className: "text-[13px] font-medium text-sand-800 truncate select-none",
2774
+ children: token.name ?? "Unnamed"
2775
+ })]
2776
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2777
+ className: `text-[11px] tabular-nums font-medium shrink-0 ${theme.cost}`,
2778
+ title: "이 토큰의 누적 비용",
2779
+ children: formatUsd(costData?.usd ?? 0)
2780
+ })]
2781
+ }),
2782
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2783
+ className: "flex flex-wrap items-center gap-1 mb-2",
2784
+ children: [
2785
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2786
+ className: `text-[10px] px-1.5 py-0.5 rounded-full uppercase ${theme.badge}`,
2787
+ children: token.provider
2788
+ }),
2789
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2790
+ className: `text-[10px] px-1.5 py-0.5 rounded-full ${token.active ? "bg-sage-100 text-sage-600" : "bg-sand-200 text-sand-500"}`,
2791
+ children: token.active ? "Active" : "Inactive"
2792
+ }),
2793
+ QUOTA_THRESHOLD_PROVIDERS.has(token.provider) && token.quota_threshold !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2794
+ className: "px-1.5 py-0.5 rounded-full bg-sienna-50 text-[10px] tabular-nums font-medium text-sienna-600",
2795
+ title: `사용률 ${token.quota_threshold}% 이상이면 이 토큰 제외`,
2796
+ children: [
2797
+ "≤ ",
2798
+ token.quota_threshold,
2799
+ "%"
2800
+ ]
2801
+ })
2802
+ ]
2803
+ }),
2804
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TokenUsage, {
2805
+ token,
2806
+ theme
2807
+ }),
2808
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2809
+ className: "mt-2 flex flex-wrap items-center gap-1.5",
2810
+ children: [
2811
+ !token.active && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReloginButton, { token }),
2812
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1" }),
2813
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WeightControl, { token }),
2814
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThresholdControl, { token })
2815
+ ]
2816
+ })
2817
+ ]
2818
+ })]
2819
+ });
2820
+ }
2821
+ var PROVIDERS = [
2822
+ "all",
2823
+ "openai",
2824
+ "anthropic"
2825
+ ];
2826
+ function UsageCard() {
2827
+ const { data, isLoading } = TokenService.useTokens("A", { orderBy: "ord-asc" });
2828
+ const queryClient = useQueryClient();
2829
+ const reorderMutation = TokenService.useReorderMutation();
2830
+ const [localTokens, setLocalTokens] = (0, import_react.useState)([]);
2831
+ const [providerFilter, setProviderFilter] = (0, import_react.useState)("all");
2832
+ (0, import_react.useEffect)(() => {
2833
+ if (data?.rows) setLocalTokens(data.rows);
2834
+ }, [data?.rows]);
2835
+ const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }));
2836
+ const handleDragEnd = (event) => {
2837
+ const { active, over } = event;
2838
+ if (!over || active.id === over.id) return;
2839
+ const activeId = Number(active.id);
2840
+ const overId = Number(over.id);
2841
+ const oldIndex = localTokens.findIndex((t) => t.id === activeId);
2842
+ const newIndex = localTokens.findIndex((t) => t.id === overId);
2843
+ if (oldIndex === -1 || newIndex === -1) return;
2844
+ const reordered = arrayMove(localTokens, oldIndex, newIndex);
2845
+ setLocalTokens(reordered);
2846
+ const queryKey = TokenService.getTokensQueryOptions("A", { orderBy: "ord-asc" }).queryKey;
2847
+ const prev = queryClient.getQueryData(queryKey);
2848
+ queryClient.setQueryData(queryKey, (old) => old ? {
2849
+ ...old,
2850
+ rows: reordered
2851
+ } : old);
2852
+ reorderMutation.mutate({ ids: reordered.map((t) => t.id) }, {
2853
+ onError: () => {
2854
+ queryClient.setQueryData(queryKey, prev);
2855
+ if (data?.rows) setLocalTokens(data.rows);
2856
+ },
2857
+ onSettled: () => {
2858
+ Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
2859
+ }
2860
+ });
2861
+ };
2862
+ if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2863
+ className: "panel p-5",
2864
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2865
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
2866
+ children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2867
+ className: "rounded-lg bg-sand-50 px-4 py-3 animate-pulse",
2868
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-3 w-16 bg-sand-200 rounded mb-3" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 w-full bg-sand-200 rounded-full" })]
2869
+ }, `skel-${i}`))
2870
+ })
2871
+ });
2872
+ if (localTokens.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2873
+ className: "panel px-5 py-10",
2874
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2875
+ className: "text-sand-400 text-[13px] text-center",
2876
+ children: "No tokens registered"
2877
+ })
2878
+ });
2879
+ const filteredTokens = providerFilter === "all" ? localTokens : localTokens.filter((t) => t.provider === providerFilter);
2880
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2881
+ className: "panel overflow-hidden",
2882
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2883
+ className: "panel-header flex items-center justify-between px-5 py-2.5",
2884
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2885
+ className: "text-[13px] font-medium text-sand-700",
2886
+ children: "Token Usage"
2887
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2888
+ className: "segmented-control flex gap-0.5",
2889
+ children: PROVIDERS.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2890
+ type: "button",
2891
+ "data-active": providerFilter === p,
2892
+ className: `px-2.5 py-[3px] text-[11px] font-medium rounded-[6px] transition-all duration-150 ${providerFilter === p ? "text-sand-800" : "text-sand-500 hover:text-sand-700"}`,
2893
+ onClick: () => setProviderFilter(p),
2894
+ children: p === "all" ? "All" : p === "openai" ? "OpenAI" : "Anthropic"
2895
+ }, p))
2896
+ })]
2897
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2898
+ className: "p-4",
2899
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DndContext, {
2900
+ sensors,
2901
+ collisionDetection: closestCenter,
2902
+ onDragEnd: handleDragEnd,
2903
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SortableContext, {
2904
+ items: filteredTokens.map((t) => String(t.id)),
2905
+ strategy: rectSortingStrategy,
2906
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2907
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
2908
+ children: filteredTokens.map((token) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SortableTokenCard, { token }, token.id))
2909
+ })
2910
+ })
2911
+ })
2912
+ })]
2913
+ });
2914
+ }
2915
+ //#endregion
2916
+ //#region src/routes/index.tsx?tsr-split=component
2917
+ function Dashboard() {
2918
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2919
+ className: "max-w-6xl mx-auto",
2920
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsageCard, {})
2921
+ });
2922
+ }
2923
+ //#endregion
2924
+ export { Dashboard as component };