@songtonyli/dsh-cli 0.1.15 → 0.1.16

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 (250) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh.mjs +1 -1
  3. package/node_modules/@bufbuild/protobuf/README.md +41 -0
  4. package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.js +66 -0
  5. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.js +18 -0
  6. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.js +31 -0
  7. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.js +28 -0
  8. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.js +18 -0
  9. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js +39 -0
  10. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.js +24 -0
  11. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.js +27 -0
  12. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.js +43 -0
  13. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.js +15 -0
  14. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.js +105 -0
  15. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.js +244 -0
  16. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.js +58 -0
  17. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.js +28 -0
  18. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.js +35 -0
  19. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js +39 -0
  20. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.js +24 -0
  21. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.js +29 -0
  22. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.js +67 -0
  23. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.js +27 -0
  24. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.js +74 -0
  25. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.js +15 -0
  26. package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +296 -0
  27. package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.js +53 -0
  28. package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.js +209 -0
  29. package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.js +168 -0
  30. package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.js +45 -0
  31. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +415 -0
  32. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +1037 -0
  33. package/node_modules/@bufbuild/protobuf/dist/commonjs/index.js +55 -0
  34. package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.js +33 -0
  35. package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.js +15 -0
  36. package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.js +70 -0
  37. package/node_modules/@bufbuild/protobuf/dist/commonjs/package.json +4 -0
  38. package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.js +131 -0
  39. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.js +36 -0
  40. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.js +78 -0
  41. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js +41 -0
  42. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.js +157 -0
  43. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.js +115 -0
  44. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.js +110 -0
  45. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.js +376 -0
  46. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +292 -0
  47. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.js +16 -0
  48. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +469 -0
  49. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.js +129 -0
  50. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.js +149 -0
  51. package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +954 -0
  52. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.js +437 -0
  53. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +625 -0
  54. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.js +684 -0
  55. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.js +21 -0
  56. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.js +47 -0
  57. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.js +481 -0
  58. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.js +358 -0
  59. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.js +220 -0
  60. package/node_modules/@bufbuild/protobuf/dist/commonjs/types.js +15 -0
  61. package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.js +26 -0
  62. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.js +188 -0
  63. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +726 -0
  64. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js +37 -0
  65. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.js +191 -0
  66. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.js +106 -0
  67. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.js +199 -0
  68. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.js +334 -0
  69. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.js +75 -0
  70. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.js +39 -0
  71. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.js +27 -0
  72. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.js +39 -0
  73. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +68 -0
  74. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.js +60 -0
  75. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.js +892 -0
  76. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.js +27 -0
  77. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.js +27 -0
  78. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.js +27 -0
  79. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.js +126 -0
  80. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.js +106 -0
  81. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.js +27 -0
  82. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.js +59 -0
  83. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.js +27 -0
  84. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.js +242 -0
  85. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.js +67 -0
  86. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js +48 -0
  87. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/json.js +44 -0
  88. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.js +57 -0
  89. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.js +66 -0
  90. package/node_modules/@bufbuild/protobuf/dist/esm/clone.js +63 -0
  91. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.js +14 -0
  92. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js +26 -0
  93. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js +25 -0
  94. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js +14 -0
  95. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js +23 -0
  96. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js +21 -0
  97. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js +24 -0
  98. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js +40 -0
  99. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js +14 -0
  100. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js +101 -0
  101. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +239 -0
  102. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js +53 -0
  103. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js +25 -0
  104. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +32 -0
  105. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js +23 -0
  106. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js +21 -0
  107. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js +26 -0
  108. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js +63 -0
  109. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js +24 -0
  110. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +71 -0
  111. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js +14 -0
  112. package/node_modules/@bufbuild/protobuf/dist/esm/create.js +293 -0
  113. package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js +50 -0
  114. package/node_modules/@bufbuild/protobuf/dist/esm/equals.js +206 -0
  115. package/node_modules/@bufbuild/protobuf/dist/esm/extensions.js +159 -0
  116. package/node_modules/@bufbuild/protobuf/dist/esm/fields.js +41 -0
  117. package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +409 -0
  118. package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +1029 -0
  119. package/node_modules/@bufbuild/protobuf/dist/esm/index.js +29 -0
  120. package/node_modules/@bufbuild/protobuf/dist/esm/is-message.js +30 -0
  121. package/node_modules/@bufbuild/protobuf/dist/esm/json-value.js +14 -0
  122. package/node_modules/@bufbuild/protobuf/dist/esm/merge.js +67 -0
  123. package/node_modules/@bufbuild/protobuf/dist/esm/package.json +4 -0
  124. package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js +128 -0
  125. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js +31 -0
  126. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js +71 -0
  127. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js +21 -0
  128. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.js +152 -0
  129. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js +109 -0
  130. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js +105 -0
  131. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js +369 -0
  132. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +284 -0
  133. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js +14 -0
  134. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +464 -0
  135. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js +124 -0
  136. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +140 -0
  137. package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +948 -0
  138. package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +433 -0
  139. package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +620 -0
  140. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.js +680 -0
  141. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.js +15 -0
  142. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.js +44 -0
  143. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.js +477 -0
  144. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.js +355 -0
  145. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.js +214 -0
  146. package/node_modules/@bufbuild/protobuf/dist/esm/types.js +14 -0
  147. package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.js +23 -0
  148. package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +184 -0
  149. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +721 -0
  150. package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +18 -0
  151. package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js +186 -0
  152. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +101 -0
  153. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js +195 -0
  154. package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +325 -0
  155. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +69 -0
  156. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +35 -0
  157. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js +24 -0
  158. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js +36 -0
  159. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +65 -0
  160. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +57 -0
  161. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +888 -0
  162. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js +24 -0
  163. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js +24 -0
  164. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +24 -0
  165. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +123 -0
  166. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +103 -0
  167. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +24 -0
  168. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js +56 -0
  169. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +24 -0
  170. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js +239 -0
  171. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +64 -0
  172. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +32 -0
  173. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/json.js +41 -0
  174. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +50 -0
  175. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +61 -0
  176. package/node_modules/@bufbuild/protobuf/package.json +136 -0
  177. package/node_modules/@deepseek-ai/dsh-base/README.i18n.yaml +2 -2
  178. package/node_modules/@deepseek-ai/dsh-base/README.md +1 -1
  179. package/node_modules/@deepseek-ai/dsh-base/README.zh.md +1 -1
  180. package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +9 -3
  181. package/node_modules/@deepseek-ai/dsh-base/package.json +1 -0
  182. package/node_modules/@deepseek-ai/dsh-client-locale/lib/client.js +7 -7
  183. package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +61 -61
  184. package/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/client.js +11 -11
  185. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +55 -55
  186. package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +182 -182
  187. package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +16 -16
  188. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +151 -151
  189. package/node_modules/@deepseek-ai/dsh-client-ui-cordis/lib/client.js +74 -74
  190. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +76 -76
  191. package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/lib/client.js +39 -39
  192. package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +16 -16
  193. package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +23 -23
  194. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +15 -15
  195. package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +8 -8
  196. package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/lib/client.js +13 -13
  197. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +27 -27
  198. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +6 -6
  199. package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +18 -18
  200. package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +22 -22
  201. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +115 -115
  202. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +14 -14
  203. package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +40 -40
  204. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.i18n.yaml +2 -2
  205. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.md +4 -2
  206. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.zh.md +4 -2
  207. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +97 -87
  208. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +35 -35
  209. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/client.js +61 -61
  210. package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/README.i18n.yaml +2 -2
  211. package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/README.md +6 -5
  212. package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/README.zh.md +6 -5
  213. package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/lib/client.js +36 -35
  214. package/node_modules/@deepseek-ai/dsh-client-ui-settings-unarchive-sessions/lib/client.js +10 -10
  215. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +41 -41
  216. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/lib/client.js +17 -17
  217. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +68 -68
  218. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.pdf.js +12 -12
  219. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/client.js +21 -21
  220. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +24 -24
  221. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.js +18 -18
  222. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.terminal.js +11 -11
  223. package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +19 -19
  224. package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +2 -2
  225. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +38 -38
  226. package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +25 -25
  227. package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +70 -70
  228. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +198 -198
  229. package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +50 -50
  230. package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +24 -24
  231. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +81 -81
  232. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/lib/client.js +25 -25
  233. package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +2 -2
  234. package/node_modules/@deepseek-ai/dsh-llm/README.md +2 -1
  235. package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +2 -1
  236. package/node_modules/@deepseek-ai/dsh-llm-cursor/README.i18n.yaml +6 -0
  237. package/node_modules/@deepseek-ai/dsh-llm-cursor/README.md +136 -0
  238. package/node_modules/@deepseek-ai/dsh-llm-cursor/README.zh.md +136 -0
  239. package/node_modules/@deepseek-ai/dsh-llm-cursor/lib/index.js +2511 -0
  240. package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +62 -0
  241. package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +3 -3
  242. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
  243. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +1 -1
  244. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +1 -1
  245. package/node_modules/@deepseek-ai/dsh-web-app/README.i18n.yaml +2 -2
  246. package/node_modules/@deepseek-ai/dsh-web-app/README.md +1 -1
  247. package/node_modules/@deepseek-ai/dsh-web-app/README.zh.md +1 -1
  248. package/package.json +5 -1
  249. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/queue-mirror.js +0 -61
  250. package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-UEJ3Ntqn.js +0 -1511
@@ -0,0 +1,954 @@
1
+ "use strict";
2
+ // Copyright 2021-2026 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.maximumEdition = exports.minimumEdition = void 0;
17
+ exports.createRegistry = createRegistry;
18
+ exports.createMutableRegistry = createMutableRegistry;
19
+ exports.createFileRegistry = createFileRegistry;
20
+ const descriptors_js_1 = require("./descriptors.js");
21
+ const text_format_js_1 = require("./wire/text-format.js");
22
+ const nested_types_js_1 = require("./reflect/nested-types.js");
23
+ const unsafe_js_1 = require("./reflect/unsafe.js");
24
+ const names_js_1 = require("./reflect/names.js");
25
+ /**
26
+ * Create a registry from the given inputs.
27
+ *
28
+ * An input can be:
29
+ * - Any message, enum, service, or extension descriptor, which adds just the
30
+ * descriptor for this type.
31
+ * - A file descriptor, which adds all typed defined in this file.
32
+ * - A registry, which adds all types from the registry.
33
+ *
34
+ * For duplicate descriptors (same type name), the one given last wins.
35
+ */
36
+ function createRegistry(...input) {
37
+ return initBaseRegistry(input);
38
+ }
39
+ /**
40
+ * Create a registry that allows adding and removing descriptors.
41
+ */
42
+ function createMutableRegistry(...input) {
43
+ const reg = initBaseRegistry(input);
44
+ return Object.assign(Object.assign({}, reg), { remove(desc) {
45
+ var _a;
46
+ if (desc.kind == "extension") {
47
+ (_a = reg.extendees.get(desc.extendee.typeName)) === null || _a === void 0 ? void 0 : _a.delete(desc.number);
48
+ }
49
+ reg.types.delete(desc.typeName);
50
+ } });
51
+ }
52
+ function createFileRegistry(...args) {
53
+ const registry = createBaseRegistry();
54
+ if (!args.length) {
55
+ return registry;
56
+ }
57
+ if ("$typeName" in args[0] &&
58
+ args[0].$typeName == "google.protobuf.FileDescriptorSet") {
59
+ for (const file of args[0].file) {
60
+ addFile(file, registry);
61
+ }
62
+ return registry;
63
+ }
64
+ if ("$typeName" in args[0]) {
65
+ const input = args[0];
66
+ const resolve = args[1];
67
+ const seen = new Set();
68
+ function recurseDeps(file) {
69
+ const deps = [];
70
+ for (const protoFileName of file.dependency) {
71
+ if (registry.getFile(protoFileName) != undefined) {
72
+ continue;
73
+ }
74
+ if (seen.has(protoFileName)) {
75
+ continue;
76
+ }
77
+ const dep = resolve(protoFileName);
78
+ if (!dep) {
79
+ throw new Error(`Unable to resolve ${protoFileName}, imported by ${file.name}`);
80
+ }
81
+ if ("kind" in dep) {
82
+ registry.addFile(dep, false, true);
83
+ }
84
+ else {
85
+ seen.add(dep.name);
86
+ deps.push(dep);
87
+ }
88
+ }
89
+ return deps.concat(...deps.map(recurseDeps));
90
+ }
91
+ for (const file of [input, ...recurseDeps(input)].reverse()) {
92
+ addFile(file, registry);
93
+ }
94
+ }
95
+ else {
96
+ for (const fileReg of args) {
97
+ for (const file of fileReg.files) {
98
+ registry.addFile(file);
99
+ }
100
+ }
101
+ }
102
+ return registry;
103
+ }
104
+ /**
105
+ * @private
106
+ */
107
+ function createBaseRegistry() {
108
+ const types = new Map();
109
+ const extendees = new Map();
110
+ const files = new Map();
111
+ return {
112
+ kind: "registry",
113
+ types,
114
+ extendees,
115
+ [Symbol.iterator]() {
116
+ return types.values();
117
+ },
118
+ get files() {
119
+ return files.values();
120
+ },
121
+ addFile(file, skipTypes, withDeps) {
122
+ files.set(file.proto.name, file);
123
+ if (!skipTypes) {
124
+ for (const type of (0, nested_types_js_1.nestedTypes)(file)) {
125
+ this.add(type);
126
+ }
127
+ }
128
+ if (withDeps) {
129
+ for (const f of file.dependencies) {
130
+ this.addFile(f, skipTypes, withDeps);
131
+ }
132
+ }
133
+ },
134
+ add(desc) {
135
+ if (desc.kind == "extension") {
136
+ let numberToExt = extendees.get(desc.extendee.typeName);
137
+ if (!numberToExt) {
138
+ extendees.set(desc.extendee.typeName,
139
+ // biome-ignore lint/suspicious/noAssignInExpressions: no
140
+ (numberToExt = new Map()));
141
+ }
142
+ numberToExt.set(desc.number, desc);
143
+ }
144
+ types.set(desc.typeName, desc);
145
+ },
146
+ get(typeName) {
147
+ return types.get(typeName);
148
+ },
149
+ getFile(fileName) {
150
+ return files.get(fileName);
151
+ },
152
+ getMessage(typeName) {
153
+ const t = types.get(typeName);
154
+ return (t === null || t === void 0 ? void 0 : t.kind) == "message" ? t : undefined;
155
+ },
156
+ getEnum(typeName) {
157
+ const t = types.get(typeName);
158
+ return (t === null || t === void 0 ? void 0 : t.kind) == "enum" ? t : undefined;
159
+ },
160
+ getExtension(typeName) {
161
+ const t = types.get(typeName);
162
+ return (t === null || t === void 0 ? void 0 : t.kind) == "extension" ? t : undefined;
163
+ },
164
+ getExtensionFor(extendee, no) {
165
+ var _a;
166
+ return (_a = extendees.get(extendee.typeName)) === null || _a === void 0 ? void 0 : _a.get(no);
167
+ },
168
+ getService(typeName) {
169
+ const t = types.get(typeName);
170
+ return (t === null || t === void 0 ? void 0 : t.kind) == "service" ? t : undefined;
171
+ },
172
+ };
173
+ }
174
+ /**
175
+ * @private
176
+ */
177
+ function initBaseRegistry(inputs) {
178
+ const registry = createBaseRegistry();
179
+ for (const input of inputs) {
180
+ switch (input.kind) {
181
+ case "registry":
182
+ for (const n of input) {
183
+ registry.add(n);
184
+ }
185
+ break;
186
+ case "file":
187
+ registry.addFile(input);
188
+ break;
189
+ default:
190
+ registry.add(input);
191
+ break;
192
+ }
193
+ }
194
+ return registry;
195
+ }
196
+ // bootstrap-inject google.protobuf.Edition.EDITION_PROTO2: const $name = $number;
197
+ const EDITION_PROTO2 = 998;
198
+ // bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name = $number;
199
+ const EDITION_PROTO3 = 999;
200
+ // bootstrap-inject google.protobuf.Edition.EDITION_UNSTABLE: const $name = $number;
201
+ const EDITION_UNSTABLE = 9999;
202
+ // bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_STRING: const $name = $number;
203
+ const TYPE_STRING = 9;
204
+ // bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_GROUP: const $name = $number;
205
+ const TYPE_GROUP = 10;
206
+ // bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_MESSAGE: const $name = $number;
207
+ const TYPE_MESSAGE = 11;
208
+ // bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_BYTES: const $name = $number;
209
+ const TYPE_BYTES = 12;
210
+ // bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_ENUM: const $name = $number;
211
+ const TYPE_ENUM = 14;
212
+ // bootstrap-inject google.protobuf.FieldDescriptorProto.Label.LABEL_REPEATED: const $name = $number;
213
+ const LABEL_REPEATED = 3;
214
+ // bootstrap-inject google.protobuf.FieldDescriptorProto.Label.LABEL_REQUIRED: const $name = $number;
215
+ const LABEL_REQUIRED = 2;
216
+ // bootstrap-inject google.protobuf.FieldOptions.JSType.JS_STRING: const $name = $number;
217
+ const JS_STRING = 1;
218
+ // bootstrap-inject google.protobuf.MethodOptions.IdempotencyLevel.IDEMPOTENCY_UNKNOWN: const $name = $number;
219
+ const IDEMPOTENCY_UNKNOWN = 0;
220
+ // bootstrap-inject google.protobuf.FeatureSet.FieldPresence.EXPLICIT: const $name = $number;
221
+ const EXPLICIT = 1;
222
+ // bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name = $number;
223
+ const IMPLICIT = 2;
224
+ // bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name = $number;
225
+ const LEGACY_REQUIRED = 3;
226
+ // bootstrap-inject google.protobuf.FeatureSet.RepeatedFieldEncoding.PACKED: const $name = $number;
227
+ const PACKED = 1;
228
+ // bootstrap-inject google.protobuf.FeatureSet.MessageEncoding.DELIMITED: const $name = $number;
229
+ const DELIMITED = 2;
230
+ // bootstrap-inject google.protobuf.FeatureSet.EnumType.OPEN: const $name = $number;
231
+ const OPEN = 1;
232
+ // bootstrap-inject google.protobuf.FeatureSet.Utf8Validation.VERIFY: const $name = $number;
233
+ const VERIFY = 2;
234
+ // biome-ignore format: want this to read well
235
+ // bootstrap-inject defaults: EDITION_PROTO2 to EDITION_2024: export const minimumEdition: SupportedEdition = $minimumEdition, maximumEdition: SupportedEdition = $maximumEdition;
236
+ // generated from protoc v34.1
237
+ exports.minimumEdition = 998, exports.maximumEdition = 1001;
238
+ const featureDefaults = {
239
+ // EDITION_PROTO2
240
+ 998: {
241
+ fieldPresence: 1, // EXPLICIT,
242
+ enumType: 2, // CLOSED,
243
+ repeatedFieldEncoding: 2, // EXPANDED,
244
+ utf8Validation: 3, // NONE,
245
+ messageEncoding: 1, // LENGTH_PREFIXED,
246
+ jsonFormat: 2, // LEGACY_BEST_EFFORT,
247
+ enforceNamingStyle: 2, // STYLE_LEGACY,
248
+ defaultSymbolVisibility: 1, // EXPORT_ALL,
249
+ },
250
+ // EDITION_PROTO3
251
+ 999: {
252
+ fieldPresence: 2, // IMPLICIT,
253
+ enumType: 1, // OPEN,
254
+ repeatedFieldEncoding: 1, // PACKED,
255
+ utf8Validation: 2, // VERIFY,
256
+ messageEncoding: 1, // LENGTH_PREFIXED,
257
+ jsonFormat: 1, // ALLOW,
258
+ enforceNamingStyle: 2, // STYLE_LEGACY,
259
+ defaultSymbolVisibility: 1, // EXPORT_ALL,
260
+ },
261
+ // EDITION_2023
262
+ 1000: {
263
+ fieldPresence: 1, // EXPLICIT,
264
+ enumType: 1, // OPEN,
265
+ repeatedFieldEncoding: 1, // PACKED,
266
+ utf8Validation: 2, // VERIFY,
267
+ messageEncoding: 1, // LENGTH_PREFIXED,
268
+ jsonFormat: 1, // ALLOW,
269
+ enforceNamingStyle: 2, // STYLE_LEGACY,
270
+ defaultSymbolVisibility: 1, // EXPORT_ALL,
271
+ },
272
+ // EDITION_2024
273
+ 1001: {
274
+ fieldPresence: 1, // EXPLICIT,
275
+ enumType: 1, // OPEN,
276
+ repeatedFieldEncoding: 1, // PACKED,
277
+ utf8Validation: 2, // VERIFY,
278
+ messageEncoding: 1, // LENGTH_PREFIXED,
279
+ jsonFormat: 1, // ALLOW,
280
+ enforceNamingStyle: 1, // STYLE2024,
281
+ defaultSymbolVisibility: 2, // EXPORT_TOP_LEVEL,
282
+ },
283
+ };
284
+ /**
285
+ * Create a descriptor for a file, add it to the registry.
286
+ */
287
+ function addFile(proto, reg) {
288
+ var _a, _b;
289
+ const file = {
290
+ kind: "file",
291
+ proto,
292
+ deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
293
+ edition: getFileEdition(proto),
294
+ name: proto.name.replace(/\.proto$/, ""),
295
+ dependencies: findFileDependencies(proto, reg),
296
+ enums: [],
297
+ messages: [],
298
+ extensions: [],
299
+ services: [],
300
+ toString() {
301
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- we asserted above
302
+ return `file ${proto.name}`;
303
+ },
304
+ };
305
+ const mapEntriesStore = new Map();
306
+ const mapEntries = {
307
+ get(typeName) {
308
+ return mapEntriesStore.get(typeName);
309
+ },
310
+ add(desc) {
311
+ var _a;
312
+ assert(((_a = desc.proto.options) === null || _a === void 0 ? void 0 : _a.mapEntry) === true);
313
+ mapEntriesStore.set(desc.typeName, desc);
314
+ },
315
+ };
316
+ for (const enumProto of proto.enumType) {
317
+ addEnum(enumProto, file, undefined, reg);
318
+ }
319
+ for (const messageProto of proto.messageType) {
320
+ addMessage(messageProto, file, undefined, reg, mapEntries);
321
+ }
322
+ for (const serviceProto of proto.service) {
323
+ addService(serviceProto, file, reg);
324
+ }
325
+ addExtensions(file, reg);
326
+ for (const mapEntry of mapEntriesStore.values()) {
327
+ // to create a map field, we need access to the map entry's fields
328
+ addFields(mapEntry, reg, mapEntries);
329
+ }
330
+ for (const message of file.messages) {
331
+ addFields(message, reg, mapEntries);
332
+ addExtensions(message, reg);
333
+ }
334
+ reg.addFile(file, true);
335
+ }
336
+ /**
337
+ * Create descriptors for extensions, and add them to the message / file,
338
+ * and to our cart.
339
+ * Recurses into nested types.
340
+ */
341
+ function addExtensions(desc, reg) {
342
+ switch (desc.kind) {
343
+ case "file":
344
+ for (const proto of desc.proto.extension) {
345
+ const ext = newField(proto, desc, reg);
346
+ desc.extensions.push(ext);
347
+ reg.add(ext);
348
+ }
349
+ break;
350
+ case "message":
351
+ for (const proto of desc.proto.extension) {
352
+ const ext = newField(proto, desc, reg);
353
+ desc.nestedExtensions.push(ext);
354
+ reg.add(ext);
355
+ }
356
+ for (const message of desc.nestedMessages) {
357
+ addExtensions(message, reg);
358
+ }
359
+ break;
360
+ }
361
+ }
362
+ /**
363
+ * Create descriptors for fields and oneof groups, and add them to the message.
364
+ * Recurses into nested types.
365
+ */
366
+ function addFields(message, reg, mapEntries) {
367
+ const allOneofs = message.proto.oneofDecl.map((proto) => newOneof(proto, message));
368
+ const oneofsSeen = new Set();
369
+ for (const proto of message.proto.field) {
370
+ const oneof = findOneof(proto, allOneofs);
371
+ const field = newField(proto, message, reg, oneof, mapEntries);
372
+ message.fields.push(field);
373
+ message.field[field.localName] = field;
374
+ if (oneof === undefined) {
375
+ message.members.push(field);
376
+ }
377
+ else {
378
+ oneof.fields.push(field);
379
+ if (!oneofsSeen.has(oneof)) {
380
+ oneofsSeen.add(oneof);
381
+ message.members.push(oneof);
382
+ }
383
+ }
384
+ }
385
+ for (const oneof of allOneofs.filter((o) => oneofsSeen.has(o))) {
386
+ message.oneofs.push(oneof);
387
+ }
388
+ for (const child of message.nestedMessages) {
389
+ addFields(child, reg, mapEntries);
390
+ }
391
+ }
392
+ /**
393
+ * Create a descriptor for an enumeration, and add it our cart and to the
394
+ * parent type, if any.
395
+ */
396
+ function addEnum(proto, file, parent, reg) {
397
+ var _a, _b, _c, _d, _e;
398
+ const sharedPrefix = findEnumSharedPrefix(proto.name, proto.value);
399
+ const desc = {
400
+ kind: "enum",
401
+ proto,
402
+ deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
403
+ file,
404
+ parent,
405
+ open: true,
406
+ name: proto.name,
407
+ typeName: makeTypeName(proto, parent, file),
408
+ value: {},
409
+ values: [],
410
+ sharedPrefix,
411
+ toString() {
412
+ return `enum ${this.typeName}`;
413
+ },
414
+ };
415
+ desc.open = isEnumOpen(desc);
416
+ reg.add(desc);
417
+ for (const p of proto.value) {
418
+ const name = p.name;
419
+ desc.values.push(
420
+ // biome-ignore lint/suspicious/noAssignInExpressions: no
421
+ (desc.value[p.number] = {
422
+ kind: "enum_value",
423
+ proto: p,
424
+ deprecated: (_d = (_c = p.options) === null || _c === void 0 ? void 0 : _c.deprecated) !== null && _d !== void 0 ? _d : false,
425
+ parent: desc,
426
+ name,
427
+ localName: (0, names_js_1.safeObjectProperty)(sharedPrefix == undefined
428
+ ? name
429
+ : name.substring(sharedPrefix.length)),
430
+ number: p.number,
431
+ toString() {
432
+ return `enum value ${desc.typeName}.${name}`;
433
+ },
434
+ }));
435
+ }
436
+ ((_e = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _e !== void 0 ? _e : file.enums).push(desc);
437
+ }
438
+ /**
439
+ * Create a descriptor for a message, including nested types, and add it to our
440
+ * cart. Note that this does not create descriptors fields.
441
+ */
442
+ function addMessage(proto, file, parent, reg, mapEntries) {
443
+ var _a, _b, _c, _d;
444
+ const desc = {
445
+ kind: "message",
446
+ proto,
447
+ deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
448
+ file,
449
+ parent,
450
+ name: proto.name,
451
+ typeName: makeTypeName(proto, parent, file),
452
+ fields: [],
453
+ field: {},
454
+ oneofs: [],
455
+ members: [],
456
+ nestedEnums: [],
457
+ nestedMessages: [],
458
+ nestedExtensions: [],
459
+ toString() {
460
+ return `message ${this.typeName}`;
461
+ },
462
+ };
463
+ if (((_c = proto.options) === null || _c === void 0 ? void 0 : _c.mapEntry) === true) {
464
+ mapEntries.add(desc);
465
+ }
466
+ else {
467
+ ((_d = parent === null || parent === void 0 ? void 0 : parent.nestedMessages) !== null && _d !== void 0 ? _d : file.messages).push(desc);
468
+ reg.add(desc);
469
+ }
470
+ for (const enumProto of proto.enumType) {
471
+ addEnum(enumProto, file, desc, reg);
472
+ }
473
+ for (const messageProto of proto.nestedType) {
474
+ addMessage(messageProto, file, desc, reg, mapEntries);
475
+ }
476
+ }
477
+ /**
478
+ * Create a descriptor for a service, including methods, and add it to our
479
+ * cart.
480
+ */
481
+ function addService(proto, file, reg) {
482
+ var _a, _b;
483
+ const desc = {
484
+ kind: "service",
485
+ proto,
486
+ deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
487
+ file,
488
+ name: proto.name,
489
+ typeName: makeTypeName(proto, undefined, file),
490
+ methods: [],
491
+ method: {},
492
+ toString() {
493
+ return `service ${this.typeName}`;
494
+ },
495
+ };
496
+ file.services.push(desc);
497
+ reg.add(desc);
498
+ for (const methodProto of proto.method) {
499
+ const method = newMethod(methodProto, desc, reg);
500
+ desc.methods.push(method);
501
+ desc.method[method.localName] = method;
502
+ }
503
+ }
504
+ /**
505
+ * Create a descriptor for a method.
506
+ */
507
+ function newMethod(proto, parent, reg) {
508
+ var _a, _b, _c, _d;
509
+ let methodKind;
510
+ if (proto.clientStreaming && proto.serverStreaming) {
511
+ methodKind = "bidi_streaming";
512
+ }
513
+ else if (proto.clientStreaming) {
514
+ methodKind = "client_streaming";
515
+ }
516
+ else if (proto.serverStreaming) {
517
+ methodKind = "server_streaming";
518
+ }
519
+ else {
520
+ methodKind = "unary";
521
+ }
522
+ const input = reg.getMessage(trimLeadingDot(proto.inputType));
523
+ const output = reg.getMessage(trimLeadingDot(proto.outputType));
524
+ assert(input, `invalid MethodDescriptorProto: input_type ${proto.inputType} not found`);
525
+ assert(output, `invalid MethodDescriptorProto: output_type ${proto.inputType} not found`);
526
+ const name = proto.name;
527
+ return {
528
+ kind: "rpc",
529
+ proto,
530
+ deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
531
+ parent,
532
+ name,
533
+ localName: (0, names_js_1.safeObjectProperty)(name.length
534
+ ? (0, names_js_1.safeObjectProperty)(name[0].toLowerCase() + name.substring(1))
535
+ : name),
536
+ methodKind,
537
+ input,
538
+ output,
539
+ idempotency: (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.idempotencyLevel) !== null && _d !== void 0 ? _d : IDEMPOTENCY_UNKNOWN,
540
+ toString() {
541
+ return `rpc ${parent.typeName}.${name}`;
542
+ },
543
+ };
544
+ }
545
+ /**
546
+ * Create a descriptor for a oneof group.
547
+ */
548
+ function newOneof(proto, parent) {
549
+ return {
550
+ kind: "oneof",
551
+ proto,
552
+ deprecated: false,
553
+ parent,
554
+ fields: [],
555
+ name: proto.name,
556
+ localName: (0, names_js_1.safeObjectProperty)((0, names_js_1.protoCamelCase)(proto.name)),
557
+ toString() {
558
+ return `oneof ${parent.typeName}.${this.name}`;
559
+ },
560
+ };
561
+ }
562
+ function newField(proto, parentOrFile, reg, oneof, mapEntries) {
563
+ var _a, _b, _c;
564
+ const isExtension = mapEntries === undefined;
565
+ const field = {
566
+ kind: "field",
567
+ proto,
568
+ deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
569
+ name: proto.name,
570
+ number: proto.number,
571
+ scalar: undefined,
572
+ message: undefined,
573
+ enum: undefined,
574
+ presence: getFieldPresence(proto, oneof, isExtension, parentOrFile),
575
+ utf8Validation: isUtf8Validated(proto, parentOrFile),
576
+ listKind: undefined,
577
+ mapKind: undefined,
578
+ mapKey: undefined,
579
+ delimitedEncoding: undefined,
580
+ packed: undefined,
581
+ longAsString: false,
582
+ getDefaultValue: undefined,
583
+ };
584
+ let toStr;
585
+ if (isExtension) {
586
+ // extension field
587
+ const file = parentOrFile.kind == "file" ? parentOrFile : parentOrFile.file;
588
+ const parent = parentOrFile.kind == "file" ? undefined : parentOrFile;
589
+ const typeName = makeTypeName(proto, parent, file);
590
+ field.kind = "extension";
591
+ field.file = file;
592
+ field.parent = parent;
593
+ field.oneof = undefined;
594
+ field.typeName = typeName;
595
+ field.jsonName = `[${typeName}]`; // option json_name is not allowed on extension fields
596
+ toStr = () => `extension ${typeName}`;
597
+ const extendee = reg.getMessage(trimLeadingDot(proto.extendee));
598
+ assert(extendee, `invalid FieldDescriptorProto: extendee ${proto.extendee} not found`);
599
+ field.extendee = extendee;
600
+ }
601
+ else {
602
+ // regular field
603
+ const parent = parentOrFile;
604
+ assert(parent.kind == "message");
605
+ field.parent = parent;
606
+ field.oneof = oneof;
607
+ field.localName = oneof
608
+ ? (0, names_js_1.protoCamelCase)(proto.name)
609
+ : (0, names_js_1.safeObjectProperty)((0, names_js_1.protoCamelCase)(proto.name));
610
+ field.jsonName = proto.jsonName;
611
+ toStr = () => `field ${parent.typeName}.${proto.name}`;
612
+ }
613
+ // A plain assignment throws where built-in prototypes are frozen. The
614
+ // attributes match what an assignment produces.
615
+ Object.defineProperty(field, "toString", {
616
+ value: toStr,
617
+ writable: true,
618
+ enumerable: true,
619
+ configurable: true,
620
+ });
621
+ const label = proto.label;
622
+ const type = proto.type;
623
+ const jstype = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.jstype;
624
+ if (label === LABEL_REPEATED) {
625
+ // list or map field
626
+ const mapEntry = type == TYPE_MESSAGE
627
+ ? mapEntries === null || mapEntries === void 0 ? void 0 : mapEntries.get(trimLeadingDot(proto.typeName))
628
+ : undefined;
629
+ if (mapEntry) {
630
+ // map field
631
+ field.fieldKind = "map";
632
+ const { key, value } = findMapEntryFields(mapEntry);
633
+ field.mapKey = key.scalar;
634
+ field.mapKind = value.fieldKind;
635
+ field.message = value.message;
636
+ field.delimitedEncoding = false; // map fields are always LENGTH_PREFIXED
637
+ field.enum = value.enum;
638
+ field.scalar = value.scalar;
639
+ return field;
640
+ }
641
+ // list field
642
+ field.fieldKind = "list";
643
+ switch (type) {
644
+ case TYPE_MESSAGE:
645
+ case TYPE_GROUP:
646
+ field.listKind = "message";
647
+ field.message = reg.getMessage(trimLeadingDot(proto.typeName));
648
+ assert(field.message);
649
+ field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
650
+ break;
651
+ case TYPE_ENUM:
652
+ field.listKind = "enum";
653
+ field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
654
+ assert(field.enum);
655
+ break;
656
+ default:
657
+ field.listKind = "scalar";
658
+ field.scalar = type;
659
+ field.longAsString = jstype == JS_STRING;
660
+ break;
661
+ }
662
+ field.packed = isPackedField(proto, parentOrFile);
663
+ return field;
664
+ }
665
+ // singular
666
+ switch (type) {
667
+ case TYPE_MESSAGE:
668
+ case TYPE_GROUP:
669
+ field.fieldKind = "message";
670
+ field.message = reg.getMessage(trimLeadingDot(proto.typeName));
671
+ assert(field.message, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);
672
+ field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
673
+ field.getDefaultValue = () => undefined;
674
+ break;
675
+ case TYPE_ENUM: {
676
+ const enumeration = reg.getEnum(trimLeadingDot(proto.typeName));
677
+ assert(enumeration !== undefined, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);
678
+ field.fieldKind = "enum";
679
+ field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
680
+ field.getDefaultValue = () => {
681
+ return (0, unsafe_js_1.unsafeIsSetExplicit)(proto, "defaultValue")
682
+ ? (0, text_format_js_1.parseTextFormatEnumValue)(enumeration, proto.defaultValue)
683
+ : undefined;
684
+ };
685
+ break;
686
+ }
687
+ default: {
688
+ field.fieldKind = "scalar";
689
+ field.scalar = type;
690
+ field.longAsString = jstype == JS_STRING;
691
+ field.getDefaultValue = () => {
692
+ return (0, unsafe_js_1.unsafeIsSetExplicit)(proto, "defaultValue")
693
+ ? (0, text_format_js_1.parseTextFormatScalarValue)(type, proto.defaultValue)
694
+ : undefined;
695
+ };
696
+ break;
697
+ }
698
+ }
699
+ return field;
700
+ }
701
+ /**
702
+ * Parse the "syntax" and "edition" fields, returning one of the supported
703
+ * editions.
704
+ */
705
+ function getFileEdition(proto) {
706
+ switch (proto.syntax) {
707
+ case "":
708
+ case "proto2":
709
+ return EDITION_PROTO2;
710
+ case "proto3":
711
+ return EDITION_PROTO3;
712
+ case "editions":
713
+ // EDITION_UNSTABLE is a sandbox for in-development features. Collapse
714
+ // it to maximumEdition so SupportedEdition and feature resolution do
715
+ // not leak the test-only edition to users.
716
+ if (proto.edition === EDITION_UNSTABLE) {
717
+ return exports.maximumEdition;
718
+ }
719
+ if (proto.edition in featureDefaults) {
720
+ return proto.edition;
721
+ }
722
+ throw new Error(`${proto.name}: unsupported edition`);
723
+ default:
724
+ throw new Error(`${proto.name}: unsupported syntax "${proto.syntax}"`);
725
+ }
726
+ }
727
+ /**
728
+ * Resolve dependencies of FileDescriptorProto to DescFile.
729
+ */
730
+ function findFileDependencies(proto, reg) {
731
+ return proto.dependency.map((wantName) => {
732
+ const dep = reg.getFile(wantName);
733
+ if (!dep) {
734
+ throw new Error(`Cannot find ${wantName}, imported by ${proto.name}`);
735
+ }
736
+ return dep;
737
+ });
738
+ }
739
+ /**
740
+ * Finds a prefix shared by enum values, for example `my_enum_` for
741
+ * `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`.
742
+ */
743
+ function findEnumSharedPrefix(enumName, values) {
744
+ const prefix = camelToSnakeCase(enumName) + "_";
745
+ for (const value of values) {
746
+ if (!value.name.toLowerCase().startsWith(prefix)) {
747
+ return undefined;
748
+ }
749
+ const shortName = value.name.substring(prefix.length);
750
+ if (shortName.length == 0) {
751
+ return undefined;
752
+ }
753
+ if (/^\d/.test(shortName)) {
754
+ // identifiers must not start with numbers
755
+ return undefined;
756
+ }
757
+ }
758
+ return prefix;
759
+ }
760
+ /**
761
+ * Converts lowerCamelCase or UpperCamelCase into lower_snake_case.
762
+ * This is used to find shared prefixes in an enum.
763
+ */
764
+ function camelToSnakeCase(camel) {
765
+ return (camel.substring(0, 1) + camel.substring(1).replace(/[A-Z]/g, (c) => "_" + c)).toLowerCase();
766
+ }
767
+ /**
768
+ * Create a fully qualified name for a protobuf type or extension field.
769
+ *
770
+ * The fully qualified name for messages, enumerations, and services is
771
+ * constructed by concatenating the package name (if present), parent
772
+ * message names (for nested types), and the type name. We omit the leading
773
+ * dot added by protobuf compilers. Examples:
774
+ * - mypackage.MyMessage
775
+ * - mypackage.MyMessage.NestedMessage
776
+ *
777
+ * The fully qualified name for extension fields is constructed by
778
+ * concatenating the package name (if present), parent message names (for
779
+ * extensions declared within a message), and the field name. Examples:
780
+ * - mypackage.extfield
781
+ * - mypackage.MyMessage.extfield
782
+ */
783
+ function makeTypeName(proto, parent, file) {
784
+ let typeName;
785
+ if (parent) {
786
+ typeName = `${parent.typeName}.${proto.name}`;
787
+ }
788
+ else if (file.proto.package.length > 0) {
789
+ typeName = `${file.proto.package}.${proto.name}`;
790
+ }
791
+ else {
792
+ typeName = `${proto.name}`;
793
+ }
794
+ return typeName;
795
+ }
796
+ /**
797
+ * Remove the leading dot from a fully qualified type name.
798
+ */
799
+ function trimLeadingDot(typeName) {
800
+ return typeName.startsWith(".") ? typeName.substring(1) : typeName;
801
+ }
802
+ /**
803
+ * Did the user put the field in a oneof group?
804
+ * Synthetic oneofs for proto3 optionals are ignored.
805
+ */
806
+ function findOneof(proto, allOneofs) {
807
+ if (!(0, unsafe_js_1.unsafeIsSetExplicit)(proto, "oneofIndex")) {
808
+ return undefined;
809
+ }
810
+ if (proto.proto3Optional) {
811
+ return undefined;
812
+ }
813
+ const oneof = allOneofs[proto.oneofIndex];
814
+ assert(oneof, `invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`);
815
+ return oneof;
816
+ }
817
+ /**
818
+ * Presence of the field.
819
+ * See https://protobuf.dev/programming-guides/field_presence/
820
+ */
821
+ function getFieldPresence(proto, oneof, isExtension, parent) {
822
+ if (proto.label == LABEL_REQUIRED) {
823
+ // proto2 required is LEGACY_REQUIRED
824
+ return LEGACY_REQUIRED;
825
+ }
826
+ if (proto.label == LABEL_REPEATED) {
827
+ // repeated fields (including maps) do not track presence
828
+ return IMPLICIT;
829
+ }
830
+ if (!!oneof || proto.proto3Optional) {
831
+ // oneof is always explicit
832
+ return EXPLICIT;
833
+ }
834
+ if (isExtension) {
835
+ // extensions always track presence
836
+ return EXPLICIT;
837
+ }
838
+ const resolved = resolveFeature("fieldPresence", { proto, parent });
839
+ if (resolved == IMPLICIT &&
840
+ (proto.type == TYPE_MESSAGE || proto.type == TYPE_GROUP)) {
841
+ // singular message field cannot be implicit
842
+ return EXPLICIT;
843
+ }
844
+ return resolved;
845
+ }
846
+ /**
847
+ * Pack this repeated field?
848
+ */
849
+ function isPackedField(proto, parent) {
850
+ if (proto.label != LABEL_REPEATED) {
851
+ return false;
852
+ }
853
+ switch (proto.type) {
854
+ case TYPE_STRING:
855
+ case TYPE_BYTES:
856
+ case TYPE_GROUP:
857
+ case TYPE_MESSAGE:
858
+ // length-delimited types cannot be packed
859
+ return false;
860
+ }
861
+ const o = proto.options;
862
+ if (o && (0, unsafe_js_1.unsafeIsSetExplicit)(o, "packed")) {
863
+ // prefer the field option over edition features
864
+ return o.packed;
865
+ }
866
+ return (PACKED ==
867
+ resolveFeature("repeatedFieldEncoding", {
868
+ proto,
869
+ parent,
870
+ }));
871
+ }
872
+ /**
873
+ * Find the key and value fields of a synthetic map entry message.
874
+ */
875
+ function findMapEntryFields(mapEntry) {
876
+ const key = mapEntry.fields.find((f) => f.number === 1);
877
+ const value = mapEntry.fields.find((f) => f.number === 2);
878
+ assert(key &&
879
+ key.fieldKind == "scalar" &&
880
+ key.scalar != descriptors_js_1.ScalarType.BYTES &&
881
+ key.scalar != descriptors_js_1.ScalarType.FLOAT &&
882
+ key.scalar != descriptors_js_1.ScalarType.DOUBLE &&
883
+ value &&
884
+ value.fieldKind != "list" &&
885
+ value.fieldKind != "map");
886
+ return { key, value };
887
+ }
888
+ /**
889
+ * Enumerations can be open or closed.
890
+ * See https://protobuf.dev/programming-guides/enum/
891
+ */
892
+ function isEnumOpen(desc) {
893
+ var _a;
894
+ return (OPEN ==
895
+ resolveFeature("enumType", {
896
+ proto: desc.proto,
897
+ parent: (_a = desc.parent) !== null && _a !== void 0 ? _a : desc.file,
898
+ }));
899
+ }
900
+ /**
901
+ * Encode the message delimited (a.k.a. proto2 group encoding), or
902
+ * length-prefixed?
903
+ */
904
+ function isDelimitedEncoding(proto, parent) {
905
+ if (proto.type == TYPE_GROUP) {
906
+ return true;
907
+ }
908
+ return (DELIMITED ==
909
+ resolveFeature("messageEncoding", {
910
+ proto,
911
+ parent,
912
+ }));
913
+ }
914
+ /**
915
+ * Reject invalid UTF-8 when reading string fields from the binary wire format?
916
+ * Driven by the resolved `utf8_validation` feature: VERIFY (proto3 / editions
917
+ * 2023+ default) enforces; NONE (proto2 default) does not.
918
+ */
919
+ function isUtf8Validated(proto, parent) {
920
+ return (VERIFY ==
921
+ resolveFeature("utf8Validation", {
922
+ proto,
923
+ parent,
924
+ }));
925
+ }
926
+ function resolveFeature(name, ref) {
927
+ var _a, _b;
928
+ const featureSet = (_a = ref.proto.options) === null || _a === void 0 ? void 0 : _a.features;
929
+ if (featureSet) {
930
+ const val = featureSet[name];
931
+ if (val != 0) {
932
+ return val;
933
+ }
934
+ }
935
+ if ("kind" in ref) {
936
+ if (ref.kind == "message") {
937
+ return resolveFeature(name, (_b = ref.parent) !== null && _b !== void 0 ? _b : ref.file);
938
+ }
939
+ const editionDefaults = featureDefaults[ref.edition];
940
+ if (!editionDefaults) {
941
+ throw new Error(`feature default for edition ${ref.edition} not found`);
942
+ }
943
+ return editionDefaults[name];
944
+ }
945
+ return resolveFeature(name, ref.parent);
946
+ }
947
+ /**
948
+ * Assert that condition is truthy or throw error (with message)
949
+ */
950
+ function assert(condition, msg) {
951
+ if (!condition) {
952
+ throw new Error(msg);
953
+ }
954
+ }