@songtonyli/dsh-cli 0.1.55 → 0.1.56

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 (86) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh.mjs +1 -1
  3. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.js +17 -1
  4. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.js +1 -1
  5. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.js +1 -1
  6. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.js +60 -41
  7. package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +2 -1
  8. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +9 -6
  9. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +30 -12
  10. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.js +3 -2
  11. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +3 -4
  12. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +2 -2
  13. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.js +31 -0
  14. package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +53 -5
  15. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +27 -5
  16. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +5 -3
  17. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.js +1 -1
  18. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.js +1 -1
  19. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/any_pb.js +2 -2
  20. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/api_pb.js +2 -2
  21. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/c_sharp_features_pb.js +33 -0
  22. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/compiler/plugin_pb.js +3 -3
  23. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/cpp_features_pb.js +34 -6
  24. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/cpp_file_options_pb.js +33 -0
  25. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/cpp_options_pb.js +22 -0
  26. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/descriptor_pb.js +49 -6
  27. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/duration_pb.js +2 -2
  28. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/empty_pb.js +2 -2
  29. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/field_mask_pb.js +2 -2
  30. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/go_features_pb.js +4 -4
  31. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/java_features_pb.js +4 -4
  32. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/json_enumvalue_options_pb.js +33 -0
  33. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/google/protobuf/json_options_pb.js +22 -0
  34. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/source_context_pb.js +2 -2
  35. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/struct_pb.js +11 -6
  36. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/timestamp_pb.js +2 -2
  37. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/type_pb.js +3 -3
  38. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/{gen/google → google}/protobuf/wrappers_pb.js +2 -2
  39. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js +15 -15
  40. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.js +1 -1
  41. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js +18 -2
  42. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +1 -1
  43. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +1 -1
  44. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +60 -41
  45. package/node_modules/@bufbuild/protobuf/dist/esm/create.js +2 -1
  46. package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +10 -7
  47. package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +31 -13
  48. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.js +3 -2
  49. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +4 -5
  50. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +3 -3
  51. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +29 -0
  52. package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +53 -5
  53. package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +28 -6
  54. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +5 -3
  55. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +1 -1
  56. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +1 -1
  57. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/any_pb.js +2 -2
  58. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/api_pb.js +2 -2
  59. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/c_sharp_features_pb.js +30 -0
  60. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/compiler/plugin_pb.js +3 -3
  61. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/cpp_features_pb.js +33 -5
  62. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/cpp_file_options_pb.js +30 -0
  63. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/cpp_options_pb.js +19 -0
  64. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/descriptor_pb.js +47 -4
  65. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/duration_pb.js +2 -2
  66. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/empty_pb.js +2 -2
  67. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/field_mask_pb.js +2 -2
  68. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/go_features_pb.js +4 -4
  69. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/java_features_pb.js +4 -4
  70. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/json_enumvalue_options_pb.js +30 -0
  71. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/google/protobuf/json_options_pb.js +19 -0
  72. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/source_context_pb.js +2 -2
  73. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/struct_pb.js +11 -6
  74. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/timestamp_pb.js +2 -2
  75. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/type_pb.js +3 -3
  76. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/{gen/google → google}/protobuf/wrappers_pb.js +2 -2
  77. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +15 -15
  78. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +1 -1
  79. package/node_modules/@bufbuild/protobuf/package.json +236 -13
  80. package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
  81. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  82. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +8 -8
  83. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +15 -4
  84. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +15 -4
  85. package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +691 -42
  86. package/package.json +2 -2
@@ -0,0 +1,33 @@
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.json = exports.JsonEnumValueOptionsSchema = exports.file_google_protobuf_json_enumvalue_options = void 0;
17
+ const file_js_1 = require("../../../codegenv2/file.js");
18
+ const descriptor_pb_js_1 = require("./descriptor_pb.js");
19
+ const message_js_1 = require("../../../codegenv2/message.js");
20
+ const extension_js_1 = require("../../../codegenv2/extension.js");
21
+ /**
22
+ * Describes the file google/protobuf/json_enumvalue_options.proto.
23
+ */
24
+ exports.file_google_protobuf_json_enumvalue_options = (0, file_js_1.fileDesc)("Cixnb29nbGUvcHJvdG9idWYvanNvbl9lbnVtdmFsdWVfb3B0aW9ucy5wcm90bxIMcGIuZW51bXZhbHVlIigKFEpzb25FbnVtVmFsdWVPcHRpb25zEg4KBnN0cmluZxgBIAEoCVgBOmIKBGpzb24SIS5nb29nbGUucHJvdG9idWYuRW51bVZhbHVlT3B0aW9ucxjmByABKAsyIi5wYi5lbnVtdmFsdWUuSnNvbkVudW1WYWx1ZU9wdGlvbnNCBrIBAwjqB1IEanNvbkIaChhjb20uZ29vZ2xlLnByb3RvYnVmLnV0aWxiCGVkaXRpb25zcOkH", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
25
+ /**
26
+ * Describes the message pb.enumvalue.JsonEnumValueOptions.
27
+ * Use `create(JsonEnumValueOptionsSchema)` to create a new message.
28
+ */
29
+ exports.JsonEnumValueOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_json_enumvalue_options, 0);
30
+ /**
31
+ * @generated from extension: pb.enumvalue.JsonEnumValueOptions json = 998;
32
+ */
33
+ exports.json = (0, extension_js_1.extDesc)(exports.file_google_protobuf_json_enumvalue_options, 0);
@@ -0,0 +1,22 @@
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.file_google_protobuf_json_options = void 0;
17
+ const file_js_1 = require("../../../codegenv2/file.js");
18
+ const json_enumvalue_options_pb_js_1 = require("./json_enumvalue_options_pb.js");
19
+ /**
20
+ * Describes the file google/protobuf/json_options.proto.
21
+ */
22
+ exports.file_google_protobuf_json_options = (0, file_js_1.fileDesc)("CiJnb29nbGUvcHJvdG9idWYvanNvbl9vcHRpb25zLnByb3RvEgJwYkIaChhjb20uZ29vZ2xlLnByb3RvYnVmLnV0aWxQAGIIZWRpdGlvbnNw6Qc", [json_enumvalue_options_pb_js_1.file_google_protobuf_json_enumvalue_options]);
@@ -14,8 +14,8 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.SourceContextSchema = exports.file_google_protobuf_source_context = void 0;
17
- const file_js_1 = require("../../../../codegenv2/file.js");
18
- const message_js_1 = require("../../../../codegenv2/message.js");
17
+ const file_js_1 = require("../../../codegenv2/file.js");
18
+ const message_js_1 = require("../../../codegenv2/message.js");
19
19
  /**
20
20
  * Describes the file google/protobuf/source_context.proto.
21
21
  */
@@ -14,9 +14,9 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.NullValueSchema = exports.NullValue = exports.ListValueSchema = exports.ValueSchema = exports.StructSchema = exports.file_google_protobuf_struct = void 0;
17
- const file_js_1 = require("../../../../codegenv2/file.js");
18
- const message_js_1 = require("../../../../codegenv2/message.js");
19
- const enum_js_1 = require("../../../../codegenv2/enum.js");
17
+ const file_js_1 = require("../../../codegenv2/file.js");
18
+ const message_js_1 = require("../../../codegenv2/message.js");
19
+ const enum_js_1 = require("../../../codegenv2/enum.js");
20
20
  /**
21
21
  * Describes the file google/protobuf/struct.proto.
22
22
  */
@@ -37,10 +37,15 @@ exports.ValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf
37
37
  */
38
38
  exports.ListValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_struct, 2);
39
39
  /**
40
- * `NullValue` is a singleton enumeration to represent the null value for the
41
- * `Value` type union.
40
+ * Represents a JSON `null`.
42
41
  *
43
- * The JSON representation for `NullValue` is JSON `null`.
42
+ * `NullValue` is a sentinel, using an enum with only one value to represent
43
+ * the null value for the `Value` type union.
44
+ *
45
+ * A field of type `NullValue` with any value other than `0` is considered
46
+ * invalid. Most ProtoJSON serializers will emit a `Value` with a `null_value`
47
+ * set as a JSON `null` regardless of the integer value, and so will round trip
48
+ * to a `0` value.
44
49
  *
45
50
  * @generated from enum google.protobuf.NullValue
46
51
  */
@@ -14,8 +14,8 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.TimestampSchema = exports.file_google_protobuf_timestamp = void 0;
17
- const file_js_1 = require("../../../../codegenv2/file.js");
18
- const message_js_1 = require("../../../../codegenv2/message.js");
17
+ const file_js_1 = require("../../../codegenv2/file.js");
18
+ const message_js_1 = require("../../../codegenv2/message.js");
19
19
  /**
20
20
  * Describes the file google/protobuf/timestamp.proto.
21
21
  */
@@ -14,11 +14,11 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.SyntaxSchema = exports.Syntax = exports.OptionSchema = exports.EnumValueSchema = exports.EnumSchema = exports.Field_CardinalitySchema = exports.Field_Cardinality = exports.Field_KindSchema = exports.Field_Kind = exports.FieldSchema = exports.TypeSchema = exports.file_google_protobuf_type = void 0;
17
- const file_js_1 = require("../../../../codegenv2/file.js");
17
+ const file_js_1 = require("../../../codegenv2/file.js");
18
18
  const any_pb_js_1 = require("./any_pb.js");
19
19
  const source_context_pb_js_1 = require("./source_context_pb.js");
20
- const message_js_1 = require("../../../../codegenv2/message.js");
21
- const enum_js_1 = require("../../../../codegenv2/enum.js");
20
+ const message_js_1 = require("../../../codegenv2/message.js");
21
+ const enum_js_1 = require("../../../codegenv2/enum.js");
22
22
  /**
23
23
  * Describes the file google/protobuf/type.proto.
24
24
  */
@@ -14,8 +14,8 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.BytesValueSchema = exports.StringValueSchema = exports.BoolValueSchema = exports.UInt32ValueSchema = exports.Int32ValueSchema = exports.UInt64ValueSchema = exports.Int64ValueSchema = exports.FloatValueSchema = exports.DoubleValueSchema = exports.file_google_protobuf_wrappers = void 0;
17
- const file_js_1 = require("../../../../codegenv2/file.js");
18
- const message_js_1 = require("../../../../codegenv2/message.js");
17
+ const file_js_1 = require("../../../codegenv2/file.js");
18
+ const message_js_1 = require("../../../codegenv2/message.js");
19
19
  /**
20
20
  * Describes the file google/protobuf/wrappers.proto.
21
21
  */
@@ -31,18 +31,18 @@ __exportStar(require("./timestamp.js"), exports);
31
31
  __exportStar(require("./duration.js"), exports);
32
32
  __exportStar(require("./any.js"), exports);
33
33
  __exportStar(require("./wrappers.js"), exports);
34
- __exportStar(require("./gen/google/protobuf/any_pb.js"), exports);
35
- __exportStar(require("./gen/google/protobuf/api_pb.js"), exports);
36
- __exportStar(require("./gen/google/protobuf/cpp_features_pb.js"), exports);
37
- __exportStar(require("./gen/google/protobuf/descriptor_pb.js"), exports);
38
- __exportStar(require("./gen/google/protobuf/duration_pb.js"), exports);
39
- __exportStar(require("./gen/google/protobuf/empty_pb.js"), exports);
40
- __exportStar(require("./gen/google/protobuf/field_mask_pb.js"), exports);
41
- __exportStar(require("./gen/google/protobuf/go_features_pb.js"), exports);
42
- __exportStar(require("./gen/google/protobuf/java_features_pb.js"), exports);
43
- __exportStar(require("./gen/google/protobuf/source_context_pb.js"), exports);
44
- __exportStar(require("./gen/google/protobuf/struct_pb.js"), exports);
45
- __exportStar(require("./gen/google/protobuf/timestamp_pb.js"), exports);
46
- __exportStar(require("./gen/google/protobuf/type_pb.js"), exports);
47
- __exportStar(require("./gen/google/protobuf/wrappers_pb.js"), exports);
48
- __exportStar(require("./gen/google/protobuf/compiler/plugin_pb.js"), exports);
34
+ __exportStar(require("./google/protobuf/any_pb.js"), exports);
35
+ __exportStar(require("./google/protobuf/api_pb.js"), exports);
36
+ __exportStar(require("./google/protobuf/cpp_features_pb.js"), exports);
37
+ __exportStar(require("./google/protobuf/descriptor_pb.js"), exports);
38
+ __exportStar(require("./google/protobuf/duration_pb.js"), exports);
39
+ __exportStar(require("./google/protobuf/empty_pb.js"), exports);
40
+ __exportStar(require("./google/protobuf/field_mask_pb.js"), exports);
41
+ __exportStar(require("./google/protobuf/go_features_pb.js"), exports);
42
+ __exportStar(require("./google/protobuf/java_features_pb.js"), exports);
43
+ __exportStar(require("./google/protobuf/source_context_pb.js"), exports);
44
+ __exportStar(require("./google/protobuf/struct_pb.js"), exports);
45
+ __exportStar(require("./google/protobuf/timestamp_pb.js"), exports);
46
+ __exportStar(require("./google/protobuf/type_pb.js"), exports);
47
+ __exportStar(require("./google/protobuf/wrappers_pb.js"), exports);
48
+ __exportStar(require("./google/protobuf/compiler/plugin_pb.js"), exports);
@@ -18,7 +18,7 @@ exports.timestampFromDate = timestampFromDate;
18
18
  exports.timestampDate = timestampDate;
19
19
  exports.timestampFromMs = timestampFromMs;
20
20
  exports.timestampMs = timestampMs;
21
- const timestamp_pb_js_1 = require("./gen/google/protobuf/timestamp_pb.js");
21
+ const timestamp_pb_js_1 = require("./google/protobuf/timestamp_pb.js");
22
22
  const create_js_1 = require("../create.js");
23
23
  const proto_int64_js_1 = require("../proto-int64.js");
24
24
  /**
@@ -11,7 +11,7 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { symbols as symbolsV2, packageName as packageNameV1, wktPublicImportPaths as wktPublicImportPathsV2, } from "../codegenv2/symbols.js";
14
+ import { symbols as symbolsV2, packageName as packageNameV1, } from "../codegenv2/symbols.js";
15
15
  /**
16
16
  * @private
17
17
  */
@@ -19,7 +19,23 @@ export const packageName = packageNameV1;
19
19
  /**
20
20
  * @private
21
21
  */
22
- export const wktPublicImportPaths = wktPublicImportPathsV2;
22
+ export const wktPublicImportPaths = {
23
+ "google/protobuf/compiler/plugin.proto": packageName + "/wkt",
24
+ "google/protobuf/any.proto": packageName + "/wkt",
25
+ "google/protobuf/api.proto": packageName + "/wkt",
26
+ "google/protobuf/cpp_features.proto": packageName + "/wkt",
27
+ "google/protobuf/descriptor.proto": packageName + "/wkt",
28
+ "google/protobuf/duration.proto": packageName + "/wkt",
29
+ "google/protobuf/empty.proto": packageName + "/wkt",
30
+ "google/protobuf/field_mask.proto": packageName + "/wkt",
31
+ "google/protobuf/go_features.proto": packageName + "/wkt",
32
+ "google/protobuf/java_features.proto": packageName + "/wkt",
33
+ "google/protobuf/source_context.proto": packageName + "/wkt",
34
+ "google/protobuf/struct.proto": packageName + "/wkt",
35
+ "google/protobuf/timestamp.proto": packageName + "/wkt",
36
+ "google/protobuf/type.proto": packageName + "/wkt",
37
+ "google/protobuf/wrappers.proto": packageName + "/wkt",
38
+ };
23
39
  /**
24
40
  * @private
25
41
  */
@@ -16,7 +16,7 @@ import { isFieldSet, clearField } from "../fields.js";
16
16
  import { base64Encode } from "../wire/base64-encoding.js";
17
17
  import { toBinary } from "../to-binary.js";
18
18
  import { clone } from "../clone.js";
19
- import { Edition, FieldDescriptorProtoSchema, FieldOptionsSchema, FileDescriptorProtoSchema, DescriptorProtoSchema, EnumDescriptorProtoSchema, } from "../wkt/gen/google/protobuf/descriptor_pb.js";
19
+ import { Edition, FieldDescriptorProtoSchema, FieldOptionsSchema, FileDescriptorProtoSchema, DescriptorProtoSchema, EnumDescriptorProtoSchema, } from "../wkt/google/protobuf/descriptor_pb.js";
20
20
  /**
21
21
  * Create necessary information to embed a file descriptor in
22
22
  * generated code.
@@ -12,7 +12,7 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
  import { base64Decode } from "../wire/base64-encoding.js";
15
- import { FileDescriptorProtoSchema } from "../wkt/gen/google/protobuf/descriptor_pb.js";
15
+ import { FileDescriptorProtoSchema } from "../wkt/google/protobuf/descriptor_pb.js";
16
16
  import { createFileRegistry } from "../registry.js";
17
17
  import { restoreJsonNames } from "./restore-json-names.js";
18
18
  import { fromBinary } from "../from-binary.js";
@@ -15,57 +15,76 @@
15
15
  * @private
16
16
  */
17
17
  export const packageName = "@bufbuild/protobuf";
18
+ const legacyWktBarrel = packageName + "/wkt";
18
19
  /**
19
20
  * @private
21
+ *
22
+ * A map from Protobuf file path to import path for the well-known types.
23
+ *
24
+ * All well-known files are exported as subpaths from @bufbuild/protobuf/wkt,
25
+ * but have been historically exported from a barrel. For backwards-compatibility,
26
+ * the existing barrel exports are maintained.
27
+ *
28
+ * For convenience, generated code continues to import from the barrel for
29
+ * commonly used WKT, and only generates the full subpath import for files
30
+ * that are rarely used.
31
+ *
32
+ * All well-known files must be listed here. New files should import from the
33
+ * full subpath.
20
34
  */
21
35
  export const wktPublicImportPaths = {
22
- "google/protobuf/compiler/plugin.proto": packageName + "/wkt",
23
- "google/protobuf/any.proto": packageName + "/wkt",
24
- "google/protobuf/api.proto": packageName + "/wkt",
25
- "google/protobuf/cpp_features.proto": packageName + "/wkt",
26
- "google/protobuf/descriptor.proto": packageName + "/wkt",
27
- "google/protobuf/duration.proto": packageName + "/wkt",
28
- "google/protobuf/empty.proto": packageName + "/wkt",
29
- "google/protobuf/field_mask.proto": packageName + "/wkt",
30
- "google/protobuf/go_features.proto": packageName + "/wkt",
31
- "google/protobuf/java_features.proto": packageName + "/wkt",
32
- "google/protobuf/source_context.proto": packageName + "/wkt",
33
- "google/protobuf/struct.proto": packageName + "/wkt",
34
- "google/protobuf/timestamp.proto": packageName + "/wkt",
35
- "google/protobuf/type.proto": packageName + "/wkt",
36
- "google/protobuf/wrappers.proto": packageName + "/wkt",
36
+ "google/protobuf/compiler/plugin.proto": legacyWktBarrel,
37
+ "google/protobuf/any.proto": legacyWktBarrel,
38
+ "google/protobuf/api.proto": packageName + "/wkt/google/protobuf/api_pb.js",
39
+ "google/protobuf/c_sharp_features.proto": packageName + "/wkt/google/protobuf/c_sharp_features_pb.js",
40
+ "google/protobuf/cpp_features.proto": packageName + "/wkt/google/protobuf/cpp_features_pb.js",
41
+ "google/protobuf/cpp_file_options.proto": packageName + "/wkt/google/protobuf/cpp_file_options_pb.js",
42
+ "google/protobuf/cpp_options.proto": packageName + "/wkt/google/protobuf/cpp_options_pb.js",
43
+ "google/protobuf/descriptor.proto": legacyWktBarrel,
44
+ "google/protobuf/duration.proto": legacyWktBarrel,
45
+ "google/protobuf/empty.proto": legacyWktBarrel,
46
+ "google/protobuf/field_mask.proto": legacyWktBarrel,
47
+ "google/protobuf/go_features.proto": packageName + "/wkt/google/protobuf/go_features_pb.js",
48
+ "google/protobuf/java_features.proto": packageName + "/wkt/google/protobuf/java_features_pb.js",
49
+ "google/protobuf/json_enumvalue_options.proto": packageName + "/wkt/google/protobuf/json_enumvalue_options_pb.js",
50
+ "google/protobuf/json_options.proto": packageName + "/wkt/google/protobuf/json_options_pb.js",
51
+ "google/protobuf/source_context.proto": packageName + "/wkt/google/protobuf/source_context_pb.js",
52
+ "google/protobuf/struct.proto": legacyWktBarrel,
53
+ "google/protobuf/timestamp.proto": legacyWktBarrel,
54
+ "google/protobuf/type.proto": packageName + "/wkt/google/protobuf/type_pb.js",
55
+ "google/protobuf/wrappers.proto": legacyWktBarrel,
37
56
  };
38
57
  /**
39
58
  * @private
40
59
  */
41
60
  // biome-ignore format: want this to read well
42
61
  export const symbols = {
43
- isMessage: { typeOnly: false, bootstrapWktFrom: "../../is-message.js", from: packageName },
44
- Message: { typeOnly: true, bootstrapWktFrom: "../../types.js", from: packageName },
45
- create: { typeOnly: false, bootstrapWktFrom: "../../create.js", from: packageName },
46
- fromJson: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: packageName },
47
- fromJsonString: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: packageName },
48
- fromBinary: { typeOnly: false, bootstrapWktFrom: "../../from-binary.js", from: packageName },
49
- toBinary: { typeOnly: false, bootstrapWktFrom: "../../to-binary.js", from: packageName },
50
- toJson: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: packageName },
51
- toJsonString: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: packageName },
52
- protoInt64: { typeOnly: false, bootstrapWktFrom: "../../proto-int64.js", from: packageName },
53
- JsonValue: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: packageName },
54
- JsonObject: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: packageName },
55
- UnknownEnum: { typeOnly: true, bootstrapWktFrom: "../../types.js", from: packageName },
62
+ isMessage: { typeOnly: false, bootstrapWktFrom: "../is-message.js", from: packageName },
63
+ Message: { typeOnly: true, bootstrapWktFrom: "../types.js", from: packageName },
64
+ create: { typeOnly: false, bootstrapWktFrom: "../create.js", from: packageName },
65
+ fromJson: { typeOnly: false, bootstrapWktFrom: "../from-json.js", from: packageName },
66
+ fromJsonString: { typeOnly: false, bootstrapWktFrom: "../from-json.js", from: packageName },
67
+ fromBinary: { typeOnly: false, bootstrapWktFrom: "../from-binary.js", from: packageName },
68
+ toBinary: { typeOnly: false, bootstrapWktFrom: "../to-binary.js", from: packageName },
69
+ toJson: { typeOnly: false, bootstrapWktFrom: "../to-json.js", from: packageName },
70
+ toJsonString: { typeOnly: false, bootstrapWktFrom: "../to-json.js", from: packageName },
71
+ protoInt64: { typeOnly: false, bootstrapWktFrom: "../proto-int64.js", from: packageName },
72
+ JsonValue: { typeOnly: true, bootstrapWktFrom: "../json-value.js", from: packageName },
73
+ JsonObject: { typeOnly: true, bootstrapWktFrom: "../json-value.js", from: packageName },
74
+ UnknownEnum: { typeOnly: true, bootstrapWktFrom: "../types.js", from: packageName },
56
75
  codegen: {
57
- boot: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/boot.js", from: packageName + "/codegenv2" },
58
- fileDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/file.js", from: packageName + "/codegenv2" },
59
- enumDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: packageName + "/codegenv2" },
60
- extDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/extension.js", from: packageName + "/codegenv2" },
61
- messageDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/message.js", from: packageName + "/codegenv2" },
62
- serviceDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/service.js", from: packageName + "/codegenv2" },
63
- tsEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: packageName + "/codegenv2" },
64
- objEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: packageName + "/codegenv2" },
65
- GenFile: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" },
66
- GenEnum: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" },
67
- GenExtension: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" },
68
- GenMessage: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" },
69
- GenService: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" },
76
+ boot: { typeOnly: false, bootstrapWktFrom: "../codegenv2/boot.js", from: packageName + "/codegenv2" },
77
+ fileDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/file.js", from: packageName + "/codegenv2" },
78
+ enumDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/enum.js", from: packageName + "/codegenv2" },
79
+ extDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/extension.js", from: packageName + "/codegenv2" },
80
+ messageDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/message.js", from: packageName + "/codegenv2" },
81
+ serviceDesc: { typeOnly: false, bootstrapWktFrom: "../codegenv2/service.js", from: packageName + "/codegenv2" },
82
+ tsEnum: { typeOnly: false, bootstrapWktFrom: "../codegenv2/enum.js", from: packageName + "/codegenv2" },
83
+ objEnum: { typeOnly: false, bootstrapWktFrom: "../codegenv2/enum.js", from: packageName + "/codegenv2" },
84
+ GenFile: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
85
+ GenEnum: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
86
+ GenExtension: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
87
+ GenMessage: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
88
+ GenService: { typeOnly: true, bootstrapWktFrom: "../codegenv2/types.js", from: packageName + "/codegenv2" },
70
89
  },
71
90
  };
@@ -15,6 +15,7 @@ import { isMessage } from "./is-message.js";
15
15
  import { ScalarType, } from "./descriptors.js";
16
16
  import { scalarZeroValue } from "./reflect/scalar.js";
17
17
  import { isObject } from "./reflect/guard.js";
18
+ import { setOwn } from "./reflect/unsafe.js";
18
19
  import { isWrapperDesc } from "./wkt/wrappers.js";
19
20
  // bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name = $number;
20
21
  const EDITION_PROTO3 = 999;
@@ -99,7 +100,7 @@ function compileCreate(desc) {
99
100
  const converted = {};
100
101
  const keys = Object.keys(initValue);
101
102
  for (let k = 0; k < keys.length; k++) {
102
- converted[keys[k]] = property.convert(initValue[keys[k]]);
103
+ setOwn(converted, keys[k], property.convert(initValue[keys[k]]));
103
104
  }
104
105
  message[name] = converted;
105
106
  }
@@ -14,7 +14,7 @@
14
14
  import { ScalarType } from "./descriptors.js";
15
15
  import { scalarZeroValue } from "./reflect/scalar.js";
16
16
  import { FieldError } from "./reflect/error.js";
17
- import { unsafeLocal } from "./reflect/unsafe.js";
17
+ import { setOwn, unsafeLocal } from "./reflect/unsafe.js";
18
18
  import { localMessageMapper } from "./reflect/message.js";
19
19
  import { create } from "./create.js";
20
20
  import { BinaryReader, WireType } from "./wire/binary-encoding.js";
@@ -312,8 +312,10 @@ function compileMapFieldReader(field) {
312
312
  case "message": {
313
313
  const { toMessage, toLocal } = localMessageMapper(field);
314
314
  const readChild = compiledReader(field.message).read;
315
- readValue = (reader, ctx) => {
316
- const child = toMessage(undefined);
315
+ // A repeated value field within one entry merges into the previous
316
+ // value, like any other singular message field.
317
+ readValue = (reader, ctx, existing) => {
318
+ const child = toMessage(existing);
317
319
  readChild(child, reader, ctx, reader.uint32());
318
320
  return toLocal(child);
319
321
  };
@@ -338,7 +340,7 @@ function compileMapFieldReader(field) {
338
340
  key = readKey(reader);
339
341
  break;
340
342
  case 2:
341
- val = readValue(reader, ctx);
343
+ val = readValue(reader, ctx, val);
342
344
  break;
343
345
  }
344
346
  }
@@ -348,9 +350,10 @@ function compileMapFieldReader(field) {
348
350
  if (val === undefined) {
349
351
  val = valueDefault();
350
352
  }
351
- // Object property keys are always strings or symbols. Assigning with a
352
- // boolean, number, or bigint key implicitly converts it to a string.
353
- record[key] = val;
353
+ // Map keys may be booleans, numbers, or bigints. Object keys are strings, so
354
+ // they are converted implicitly. setOwn() is needed because a key can be
355
+ // "__proto__".
356
+ setOwn(record, key, val);
354
357
  };
355
358
  }
356
359
  /**
@@ -18,7 +18,7 @@ import { FieldError, isFieldError } from "./reflect/error.js";
18
18
  import { formatVal, reasonSingular, checkScalarValue, } from "./reflect/reflect-check.js";
19
19
  import { protoSnakeCase } from "./reflect/names.js";
20
20
  import { scalarZeroValue } from "./reflect/scalar.js";
21
- import { unsafeLocal } from "./reflect/unsafe.js";
21
+ import { setOwn, unsafeLocal } from "./reflect/unsafe.js";
22
22
  import { localMessageMapper } from "./reflect/message.js";
23
23
  import { base64Decode } from "./wire/base64-encoding.js";
24
24
  import { hasCustomJsonRepresentation, isWrapperDesc, anyPack, ListValueSchema, NullValue, StructSchema, ValueSchema, } from "./wkt/index.js";
@@ -111,9 +111,14 @@ export function enumFromJson(descEnum, json) {
111
111
  }
112
112
  /**
113
113
  * Is the given value a JSON enum value?
114
+ *
115
+ * For an enum value with a custom JSON name set with the option
116
+ * `(pb.enumvalue.json).string`, this function only returns true for the
117
+ * custom name, while fromJson() and enumFromJson() also accept the Protobuf
118
+ * name.
114
119
  */
115
120
  export function isEnumJson(descEnum, value) {
116
- return undefined !== descEnum.values.find((v) => v.name === value);
121
+ return descEnum.values.some((v) => v.jsonName === value);
117
122
  }
118
123
  const compiledReaders = new WeakMap();
119
124
  /**
@@ -543,9 +548,10 @@ function compileMapFieldReader(field) {
543
548
  throw new FieldError(field, `map entry ${formatVal(key)}: ${reasonSingular(field, value, check)}`);
544
549
  }
545
550
  }
546
- // Object property keys are always strings or symbols. Assigning with a
547
- // boolean, number, or bigint key implicitly converts it to a string.
548
- record[key] = toLocalValue(value);
551
+ // Map keys may be booleans, numbers, or bigints. Object keys are strings, so
552
+ // they are converted implicitly. setOwn() is needed because a key can be
553
+ // "__proto__".
554
+ setOwn(record, key, toLocalValue(value));
549
555
  }
550
556
  };
551
557
  }
@@ -558,7 +564,16 @@ const tokenIgnoredUnknownEnum = Symbol();
558
564
  */
559
565
  function compileEnumConverter(desc) {
560
566
  const zero = desc.values[0].number;
561
- const values = desc.values;
567
+ // Protobuf compilers reject a custom JSON name that equals the Protobuf name
568
+ // of another value. As a fallback, the Protobuf name takes precedence, so we
569
+ // add Protobuf names last.
570
+ const numbers = new Map();
571
+ for (const value of desc.values) {
572
+ numbers.set(value.jsonName, value.number);
573
+ }
574
+ for (const value of desc.values) {
575
+ numbers.set(value.name, value.number);
576
+ }
562
577
  return (json, ignoreUnknownFields) => {
563
578
  if (json === null) {
564
579
  return zero;
@@ -570,9 +585,9 @@ function compileEnumConverter(desc) {
570
585
  }
571
586
  break;
572
587
  case "string": {
573
- const value = values.find((ev) => ev.name === json);
574
- if (value !== undefined) {
575
- return value.number;
588
+ const number = numbers.get(json);
589
+ if (number !== undefined) {
590
+ return number;
576
591
  }
577
592
  if (ignoreUnknownFields) {
578
593
  return tokenIgnoredUnknownEnum;
@@ -902,9 +917,12 @@ function anyFromJson(any, json, ctx) {
902
917
  compiledReader(desc)(message, json.value, ctx);
903
918
  }
904
919
  else {
905
- const copy = Object.assign({}, json);
906
- // biome-ignore lint/performance/noDelete: <explanation>
907
- delete copy["@type"];
920
+ const copy = {};
921
+ for (const key of Object.keys(json)) {
922
+ if (key !== "@type") {
923
+ setOwn(copy, key, json[key]);
924
+ }
925
+ }
908
926
  compiledReader(desc)(message, copy, ctx);
909
927
  }
910
928
  anyPack(desc, message, any);
@@ -979,7 +997,7 @@ function structFromJson(struct, json, ctx) {
979
997
  const key = keys[i];
980
998
  const parsedValue = create(ValueSchema);
981
999
  valueFromJson(parsedValue, json[key], ctx);
982
- struct.fields[key] = parsedValue;
1000
+ setOwn(struct.fields, key, parsedValue);
983
1001
  }
984
1002
  }
985
1003
  function valueFromJson(value, json, ctx) {
@@ -13,6 +13,7 @@
13
13
  // limitations under the License.
14
14
  import { create } from "../create.js";
15
15
  import { isObject } from "./guard.js";
16
+ import { setOwn } from "./unsafe.js";
16
17
  import { isWrapperDesc } from "../wkt/wrappers.js";
17
18
  // google.protobuf.NullValue.NULL_VALUE;
18
19
  const NULL_VALUE = 0;
@@ -76,7 +77,7 @@ export function wktStructToReflect(json) {
76
77
  };
77
78
  if (isObject(json)) {
78
79
  for (const k of Object.keys(json)) {
79
- struct.fields[k] = wktValueToReflect(json[k]);
80
+ setOwn(struct.fields, k, wktValueToReflect(json[k]));
80
81
  }
81
82
  }
82
83
  return struct;
@@ -89,7 +90,7 @@ export function wktStructToReflect(json) {
89
90
  export function wktStructToLocal(val) {
90
91
  const json = {};
91
92
  for (const k of Object.keys(val.fields)) {
92
- json[k] = wktValueToLocal(val.fields[k]);
93
+ setOwn(json, k, wktValueToLocal(val.fields[k]));
93
94
  }
94
95
  return json;
95
96
  }
@@ -15,7 +15,7 @@ import { ScalarType, } from "../descriptors.js";
15
15
  import { isMessage } from "../is-message.js";
16
16
  import { FieldError } from "./error.js";
17
17
  import { isReflectList, isReflectMap, isReflectMessage } from "./guard.js";
18
- import { FLOAT32_MAX, FLOAT32_MIN, INT32_MAX, INT32_MIN, UINT32_MAX, } from "../wire/binary-encoding.js";
18
+ import { INT32_MAX, INT32_MIN, UINT32_MAX } from "../wire/binary-encoding.js";
19
19
  import { getTextEncoding } from "../wire/text-encoding.js";
20
20
  import { protoInt64 } from "../proto-int64.js";
21
21
  /**
@@ -96,10 +96,9 @@ export function checkScalarValue(scalar) {
96
96
  if (typeof value != "number") {
97
97
  return false;
98
98
  }
99
- if (Number.isNaN(value) || !Number.isFinite(value)) {
100
- return true;
101
- }
102
- if (value > FLOAT32_MAX || value < FLOAT32_MIN) {
99
+ // float32 is represented with regular 64-bit numbers. A value too large for
100
+ // a float32 becomes infinity when rounded. NaN and infinity are valid values.
101
+ if (!Number.isFinite(Math.fround(value)) && Number.isFinite(value)) {
103
102
  return `${value.toFixed()} out of range`;
104
103
  }
105
104
  return true;
@@ -14,7 +14,7 @@
14
14
  import { ScalarType, } from "../descriptors.js";
15
15
  import { checkField, checkListItem, checkMapEntry } from "./reflect-check.js";
16
16
  import { FieldError } from "./error.js";
17
- import { unsafeClear, unsafeGet, unsafeIsSet, unsafeLocal, unsafeOneofCase, unsafeSet, } from "./unsafe.js";
17
+ import { getOwn, setOwn, unsafeClear, unsafeGet, unsafeIsSet, unsafeLocal, unsafeOneofCase, unsafeSet, } from "./unsafe.js";
18
18
  import { create } from "../create.js";
19
19
  import { isWrapper, isWrapperDesc } from "../wkt/wrappers.js";
20
20
  import { scalarZeroValue } from "./scalar.js";
@@ -243,7 +243,7 @@ class ReflectMapImpl {
243
243
  throw err;
244
244
  }
245
245
  }
246
- this.obj[mapKeyToLocal(key)] = mapValueToLocal(this._field, value);
246
+ setOwn(this.obj, mapKeyToLocal(key), mapValueToLocal(this._field, value));
247
247
  return this;
248
248
  }
249
249
  delete(key) {
@@ -260,7 +260,7 @@ class ReflectMapImpl {
260
260
  }
261
261
  }
262
262
  get(key) {
263
- let val = this.obj[mapKeyToLocal(key)];
263
+ let val = getOwn(this.obj, mapKeyToLocal(key));
264
264
  if (val !== undefined) {
265
265
  val = mapValueToReflect(this._field, val, this.check);
266
266
  }