@songtonyli/dsh-cli 0.1.54 → 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 (149) 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-agent-preset/skills/cordis-composition-reference/references/packages.md +1 -1
  81. package/node_modules/@deepseek-ai/dsh-client-locale/lib/client.js +7 -7
  82. package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +61 -61
  83. package/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/client.js +10 -10
  84. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +49 -49
  85. package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +207 -207
  86. package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +16 -16
  87. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +153 -153
  88. package/node_modules/@deepseek-ai/dsh-client-ui-cordis/lib/client.js +74 -74
  89. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +80 -80
  90. package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/lib/client.js +39 -39
  91. package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +16 -16
  92. package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +23 -23
  93. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +37 -37
  94. package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +9 -9
  95. package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/lib/client.js +12 -12
  96. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +31 -31
  97. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +8 -8
  98. package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +18 -18
  99. package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +22 -22
  100. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +139 -139
  101. package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/OnboardingSurface.module.css +28 -0
  102. package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/OnboardingSurface.d.ts +11 -0
  103. package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
  104. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +182 -182
  105. package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +128 -128
  106. package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +49 -49
  107. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +87 -87
  108. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +41 -41
  109. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/client.js +13 -13
  110. package/node_modules/@deepseek-ai/dsh-client-ui-settings-session-log/lib/client.js +5 -5
  111. package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/lib/client.js +24 -24
  112. package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/lib/client.js +27 -27
  113. package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/lib/client.js +42 -42
  114. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +44 -44
  115. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/lib/client.js +25 -25
  116. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.excel.js +9 -9
  117. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +70 -70
  118. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.pdf.js +9 -9
  119. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/client.js +18 -18
  120. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +26 -26
  121. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.js +16 -16
  122. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.terminal.js +11 -11
  123. package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +19 -19
  124. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +37 -37
  125. package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +27 -27
  126. package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +99 -99
  127. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +197 -197
  128. package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +73 -73
  129. package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +26 -26
  130. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +92 -92
  131. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +2 -2
  132. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +1 -1
  133. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +1 -1
  134. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/cordis.patch.yml +3 -0
  135. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +11 -5
  136. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +4 -0
  137. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/lib/client.js +32 -32
  138. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/client.js +24 -24
  139. package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types-DxezulnA.js +1324 -0
  140. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/persistence.js +30 -0
  141. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/projection.js +68 -0
  142. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/transaction.js +22 -0
  143. package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +3 -3
  144. package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-DGV26RBf.js +1525 -0
  145. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +8 -8
  146. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +15 -4
  147. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +15 -4
  148. package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +691 -42
  149. package/package.json +2 -2
@@ -100,6 +100,35 @@ export function unsafeSet(target, field, value) {
100
100
  target[field.localName] = value;
101
101
  }
102
102
  }
103
+ /**
104
+ * Set a property, treating __proto__ as an own data property.
105
+ *
106
+ * @private
107
+ */
108
+ export function setOwn(obj, key, value) {
109
+ if (key === "__proto__") {
110
+ Object.defineProperty(obj, "__proto__", {
111
+ value,
112
+ writable: true,
113
+ enumerable: true,
114
+ configurable: true,
115
+ });
116
+ }
117
+ else {
118
+ // Plain assignment is the engine's optimized fast path: defineProperty is
119
+ // several times slower and can deoptimize the object, so we reserve it for
120
+ // the only key that actually needs it.
121
+ obj[key] = value;
122
+ }
123
+ }
124
+ /**
125
+ * Get a property, disregarding inherited members.
126
+ *
127
+ * @private
128
+ */
129
+ export function getOwn(obj, key) {
130
+ return Object.prototype.hasOwnProperty.call(obj, key) ? obj[key] : undefined;
131
+ }
103
132
  /**
104
133
  * Resets the field, so that unsafeIsSet() will return false.
105
134
  *
@@ -16,6 +16,7 @@ import { parseTextFormatEnumValue, parseTextFormatScalarValue, } from "./wire/te
16
16
  import { nestedTypes } from "./reflect/nested-types.js";
17
17
  import { unsafeIsSetExplicit } from "./reflect/unsafe.js";
18
18
  import { protoCamelCase, safeObjectProperty } from "./reflect/names.js";
19
+ import { BinaryReader, WireType } from "./wire/binary-encoding.js";
19
20
  /**
20
21
  * Create a registry from the given inputs.
21
22
  *
@@ -226,9 +227,9 @@ const OPEN = 1;
226
227
  // bootstrap-inject google.protobuf.FeatureSet.Utf8Validation.VERIFY: const $name = $number;
227
228
  const VERIFY = 2;
228
229
  // biome-ignore format: want this to read well
229
- // bootstrap-inject defaults: EDITION_PROTO2 to EDITION_2024: export const minimumEdition: SupportedEdition = $minimumEdition, maximumEdition: SupportedEdition = $maximumEdition;
230
- // generated from protoc v34.1
231
- export const minimumEdition = 998, maximumEdition = 1001;
230
+ // bootstrap-inject defaults: EDITION_PROTO2 to EDITION_2026: export const minimumEdition: SupportedEdition = $minimumEdition, maximumEdition: SupportedEdition = $maximumEdition;
231
+ // generated from protoc v36.2
232
+ export const minimumEdition = 998, maximumEdition = 1002;
232
233
  const featureDefaults = {
233
234
  // EDITION_PROTO2
234
235
  998: {
@@ -240,6 +241,7 @@ const featureDefaults = {
240
241
  jsonFormat: 2, // LEGACY_BEST_EFFORT,
241
242
  enforceNamingStyle: 2, // STYLE_LEGACY,
242
243
  defaultSymbolVisibility: 1, // EXPORT_ALL,
244
+ enforceProtoLimits: 1, // LEGACY_NO_EXPLICIT_LIMITS,
243
245
  },
244
246
  // EDITION_PROTO3
245
247
  999: {
@@ -251,6 +253,7 @@ const featureDefaults = {
251
253
  jsonFormat: 1, // ALLOW,
252
254
  enforceNamingStyle: 2, // STYLE_LEGACY,
253
255
  defaultSymbolVisibility: 1, // EXPORT_ALL,
256
+ enforceProtoLimits: 1, // LEGACY_NO_EXPLICIT_LIMITS,
254
257
  },
255
258
  // EDITION_2023
256
259
  1000: {
@@ -262,6 +265,7 @@ const featureDefaults = {
262
265
  jsonFormat: 1, // ALLOW,
263
266
  enforceNamingStyle: 2, // STYLE_LEGACY,
264
267
  defaultSymbolVisibility: 1, // EXPORT_ALL,
268
+ enforceProtoLimits: 1, // LEGACY_NO_EXPLICIT_LIMITS,
265
269
  },
266
270
  // EDITION_2024
267
271
  1001: {
@@ -273,6 +277,19 @@ const featureDefaults = {
273
277
  jsonFormat: 1, // ALLOW,
274
278
  enforceNamingStyle: 1, // STYLE2024,
275
279
  defaultSymbolVisibility: 2, // EXPORT_TOP_LEVEL,
280
+ enforceProtoLimits: 1, // LEGACY_NO_EXPLICIT_LIMITS,
281
+ },
282
+ // EDITION_2026
283
+ 1002: {
284
+ fieldPresence: 1, // EXPLICIT,
285
+ enumType: 1, // OPEN,
286
+ repeatedFieldEncoding: 1, // PACKED,
287
+ utf8Validation: 2, // VERIFY,
288
+ messageEncoding: 1, // LENGTH_PREFIXED,
289
+ jsonFormat: 1, // ALLOW,
290
+ enforceNamingStyle: 3, // STYLE2026,
291
+ defaultSymbolVisibility: 4, // STRICT,
292
+ enforceProtoLimits: 2, // PROTO_LIMITS2026,
276
293
  },
277
294
  };
278
295
  /**
@@ -388,7 +405,7 @@ function addFields(message, reg, mapEntries) {
388
405
  * parent type, if any.
389
406
  */
390
407
  function addEnum(proto, file, parent, reg) {
391
- var _a, _b, _c, _d, _e;
408
+ var _a, _b, _c, _d, _e, _f;
392
409
  const sharedPrefix = findEnumSharedPrefix(proto.name, proto.value);
393
410
  const desc = {
394
411
  kind: "enum",
@@ -422,12 +439,13 @@ function addEnum(proto, file, parent, reg) {
422
439
  ? name
423
440
  : name.substring(sharedPrefix.length)),
424
441
  number: p.number,
442
+ jsonName: (_e = findEnumValueJsonName(p)) !== null && _e !== void 0 ? _e : name,
425
443
  toString() {
426
444
  return `enum value ${desc.typeName}.${name}`;
427
445
  },
428
446
  }));
429
447
  }
430
- ((_e = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _e !== void 0 ? _e : file.enums).push(desc);
448
+ ((_f = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _f !== void 0 ? _f : file.enums).push(desc);
431
449
  }
432
450
  /**
433
451
  * Create a descriptor for a message, including nested types, and add it to our
@@ -751,6 +769,36 @@ function findEnumSharedPrefix(enumName, values) {
751
769
  }
752
770
  return prefix;
753
771
  }
772
+ /**
773
+ * Finds the custom JSON name of an enum value, set with the option
774
+ * `(pb.enumvalue.json).string` from google/protobuf/json_enumvalue_options.proto.
775
+ *
776
+ * Extensions are stored as unknown fields, so we read the option from the
777
+ * wire format instead of importing the extension, which depends on this file.
778
+ */
779
+ function findEnumValueJsonName(proto) {
780
+ var _a, _b;
781
+ const extensionNumber = 998; // extend EnumValueOptions { JsonEnumValueOptions json = 998; }
782
+ const fieldNumber = 1; // message JsonEnumValueOptions { string string = 1; }
783
+ let jsonName;
784
+ for (const uf of (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.$unknown) !== null && _b !== void 0 ? _b : []) {
785
+ if (uf.no !== extensionNumber || uf.wireType !== WireType.LengthDelimited) {
786
+ continue;
787
+ }
788
+ // Occurrences of a message field are merged, so the last value wins.
789
+ const reader = new BinaryReader(new BinaryReader(uf.data).bytes());
790
+ while (reader.pos < reader.len) {
791
+ const [no, wireType] = reader.tag();
792
+ if (no === fieldNumber && wireType === WireType.LengthDelimited) {
793
+ jsonName = reader.string();
794
+ }
795
+ else {
796
+ reader.skip(wireType, no);
797
+ }
798
+ }
799
+ }
800
+ return jsonName;
801
+ }
754
802
  /**
755
803
  * Converts lowerCamelCase or UpperCamelCase into lower_snake_case.
756
804
  * This is used to find shared prefixes in an enum.
@@ -20,7 +20,7 @@ import { base64Encode } from "./wire/index.js";
20
20
  import { createExtensionContainer, getExtension } from "./extensions.js";
21
21
  import { checkField, formatVal } from "./reflect/reflect-check.js";
22
22
  import { FieldError } from "./reflect/error.js";
23
- import { unsafeLocal } from "./reflect/unsafe.js";
23
+ import { setOwn, unsafeLocal } from "./reflect/unsafe.js";
24
24
  import { scalarZeroValue } from "./reflect/scalar.js";
25
25
  import { localMessageMapper } from "./reflect/message.js";
26
26
  // bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name = $number;
@@ -59,7 +59,7 @@ export function enumToJson(descEnum, value) {
59
59
  if (descEnum.typeName == "google.protobuf.NullValue") {
60
60
  return null;
61
61
  }
62
- const name = (_a = descEnum.value[value]) === null || _a === void 0 ? void 0 : _a.name;
62
+ const name = (_a = descEnum.value[value]) === null || _a === void 0 ? void 0 : _a.jsonName;
63
63
  if (name === undefined) {
64
64
  throw new Error(`${value} is not a value in ${descEnum}`);
65
65
  }
@@ -113,10 +113,32 @@ function compileMessage(desc) {
113
113
  // resolve to this instance instead of compiling endlessly.
114
114
  compiledWriters.set(desc, compiledWriter);
115
115
  for (const field of sortedFields) {
116
- fieldWriters.push(compileField(field));
116
+ const writeField = compileField(field);
117
+ // Both names a field can be written under are fixed by the schema, so we
118
+ // decide here, once, whether a field needs the wrapper. Ordinary fields
119
+ // get the plain writer, keeping the hot path free of any per-write check.
120
+ fieldWriters.push(field.jsonName === "__proto__" || field.name === "__proto__"
121
+ ? writeOwnKeys(writeField)
122
+ : writeField);
117
123
  }
118
124
  return compiledWriter;
119
125
  }
126
+ /**
127
+ * Wrap a field encoder so that a JSON name or proto name of "__proto__" ends
128
+ * up as an own property. Assigning that key on a plain object hits the
129
+ * inherited accessor instead, and the field is silently lost. The encoder
130
+ * writes to a null-prototype object, where the key is ordinary, and the
131
+ * result is copied to the real output with setOwn().
132
+ */
133
+ function writeOwnKeys(writeField) {
134
+ return (opts, message, json) => {
135
+ const tmp = Object.create(null);
136
+ writeField(opts, message, tmp);
137
+ for (const key of Object.keys(tmp)) {
138
+ setOwn(json, key, tmp[key]);
139
+ }
140
+ };
141
+ }
120
142
  /**
121
143
  * Compile an encoder for a well-known type with a custom JSON representation,
122
144
  * or return undefined for other messages.
@@ -348,7 +370,7 @@ function compileMapValue(field) {
348
370
  const jsonObject = {};
349
371
  for (let i = 0; i < keys.length; i++) {
350
372
  const key = keys[i];
351
- jsonObject[key] = writeMapValue(opts, record[key]);
373
+ setOwn(jsonObject, key, writeMapValue(opts, record[key]));
352
374
  }
353
375
  return jsonObject;
354
376
  };
@@ -385,7 +407,7 @@ function compileEnumValue(field) {
385
407
  return value;
386
408
  }
387
409
  // If we don't know the enum value, just return the number.
388
- return (_b = (_a = desc.value[value]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : value;
410
+ return (_b = (_a = desc.value[value]) === null || _a === void 0 ? void 0 : _a.jsonName) !== null && _b !== void 0 ? _b : value;
389
411
  };
390
412
  }
391
413
  function errorEnumValue(desc, value) {
@@ -564,7 +586,7 @@ function structToJson(val) {
564
586
  const keys = Object.keys(val.fields);
565
587
  for (let i = 0; i < keys.length; i++) {
566
588
  const key = keys[i];
567
- json[key] = valueToJson(val.fields[key]);
589
+ setOwn(json, key, valueToJson(val.fields[key]));
568
590
  }
569
591
  return json;
570
592
  }
@@ -702,7 +702,7 @@ function assertUInt32(arg) {
702
702
  throw new Error("invalid uint32: " + arg);
703
703
  }
704
704
  /**
705
- * Assert a valid protobuf float value as a number or string.
705
+ * Assert a valid protobuf float32 value as a number or string.
706
706
  */
707
707
  function assertFloat32(arg) {
708
708
  if (typeof arg == "string") {
@@ -715,7 +715,9 @@ function assertFloat32(arg) {
715
715
  else if (typeof arg != "number") {
716
716
  throw new Error("invalid float32: " + typeof arg);
717
717
  }
718
- if (Number.isFinite(arg) &&
719
- (arg > FLOAT32_MAX || arg < FLOAT32_MIN))
718
+ // float32 is represented with regular 64-bit numbers. A value too large for
719
+ // a float32 becomes infinity when rounded. NaN and infinity are valid values.
720
+ if (!Number.isFinite(Math.fround(arg)) && Number.isFinite(arg)) {
720
721
  throw new Error("invalid float32: " + arg);
722
+ }
721
723
  }
@@ -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 { AnySchema } from "./gen/google/protobuf/any_pb.js";
14
+ import { AnySchema } from "./google/protobuf/any_pb.js";
15
15
  import { create } from "../create.js";
16
16
  import { toBinary } from "../to-binary.js";
17
17
  import { fromBinary, mergeFromBinary } from "../from-binary.js";
@@ -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 { DurationSchema } from "./gen/google/protobuf/duration_pb.js";
14
+ import { DurationSchema } from "./google/protobuf/duration_pb.js";
15
15
  import { create } from "../create.js";
16
16
  import { protoInt64 } from "../proto-int64.js";
17
17
  /**
@@ -11,8 +11,8 @@
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 { fileDesc } from "../../../../codegenv2/file.js";
15
- import { messageDesc } from "../../../../codegenv2/message.js";
14
+ import { fileDesc } from "../../../codegenv2/file.js";
15
+ import { messageDesc } from "../../../codegenv2/message.js";
16
16
  /**
17
17
  * Describes the file google/protobuf/any.proto.
18
18
  */
@@ -11,10 +11,10 @@
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 { fileDesc } from "../../../../codegenv2/file.js";
14
+ import { fileDesc } from "../../../codegenv2/file.js";
15
15
  import { file_google_protobuf_source_context } from "./source_context_pb.js";
16
16
  import { file_google_protobuf_type } from "./type_pb.js";
17
- import { messageDesc } from "../../../../codegenv2/message.js";
17
+ import { messageDesc } from "../../../codegenv2/message.js";
18
18
  /**
19
19
  * Describes the file google/protobuf/api.proto.
20
20
  */
@@ -0,0 +1,30 @@
1
+ // Copyright 2021-2026 Buf Technologies, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { fileDesc } from "../../../codegenv2/file.js";
15
+ import { file_google_protobuf_descriptor } from "./descriptor_pb.js";
16
+ import { messageDesc } from "../../../codegenv2/message.js";
17
+ import { extDesc } from "../../../codegenv2/extension.js";
18
+ /**
19
+ * Describes the file google/protobuf/c_sharp_features.proto.
20
+ */
21
+ export const file_google_protobuf_c_sharp_features = /*@__PURE__*/ fileDesc("CiZnb29nbGUvcHJvdG9idWYvY19zaGFycF9mZWF0dXJlcy5wcm90bxICcGIiUwoOQ1NoYXJwRmVhdHVyZXMSQQoYbnVsbGFibGVfcmVmZXJlbmNlX3R5cGVzGAEgASgIQh+IAQGYAQSYAQOYAQGiAQoSBWZhbHNlGIQHsgEDCOoHOkgKBmNzaGFycBIbLmdvb2dsZS5wcm90b2J1Zi5GZWF0dXJlU2V0GOwHIAEoCzISLnBiLkNTaGFycEZlYXR1cmVzUgZjc2hhcnBCOUIYQ1NoYXJwRmVhdHVyZXNPdXRlckNsYXNzUAGqAhpHb29nbGUuUHJvdG9idWYuUmVmbGVjdGlvbg", [file_google_protobuf_descriptor]);
22
+ /**
23
+ * Describes the message pb.CSharpFeatures.
24
+ * Use `create(CSharpFeaturesSchema)` to create a new message.
25
+ */
26
+ export const CSharpFeaturesSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_c_sharp_features, 0);
27
+ /**
28
+ * @generated from extension: optional pb.CSharpFeatures csharp = 1004;
29
+ */
30
+ export const csharp = /*@__PURE__*/ extDesc(file_google_protobuf_c_sharp_features, 0);
@@ -11,10 +11,10 @@
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 { fileDesc } from "../../../../../codegenv2/file.js";
14
+ import { fileDesc } from "../../../../codegenv2/file.js";
15
15
  import { file_google_protobuf_descriptor } from "../descriptor_pb.js";
16
- import { messageDesc } from "../../../../../codegenv2/message.js";
17
- import { enumDesc } from "../../../../../codegenv2/enum.js";
16
+ import { messageDesc } from "../../../../codegenv2/message.js";
17
+ import { enumDesc } from "../../../../codegenv2/enum.js";
18
18
  /**
19
19
  * Describes the file google/protobuf/compiler/plugin.proto.
20
20
  */
@@ -11,15 +11,15 @@
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 { fileDesc } from "../../../../codegenv2/file.js";
14
+ import { fileDesc } from "../../../codegenv2/file.js";
15
15
  import { file_google_protobuf_descriptor } from "./descriptor_pb.js";
16
- import { messageDesc } from "../../../../codegenv2/message.js";
17
- import { enumDesc } from "../../../../codegenv2/enum.js";
18
- import { extDesc } from "../../../../codegenv2/extension.js";
16
+ import { messageDesc } from "../../../codegenv2/message.js";
17
+ import { enumDesc } from "../../../codegenv2/enum.js";
18
+ import { extDesc } from "../../../codegenv2/extension.js";
19
19
  /**
20
20
  * Describes the file google/protobuf/cpp_features.proto.
21
21
  */
22
- export const file_google_protobuf_cpp_features = /*@__PURE__*/ fileDesc("CiJnb29nbGUvcHJvdG9idWYvY3BwX2ZlYXR1cmVzLnByb3RvEgJwYiL8AwoLQ3BwRmVhdHVyZXMS+wEKEmxlZ2FjeV9jbG9zZWRfZW51bRgBIAEoCELeAYgBAZgBBJgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAbgBCOgHEOgHGq8BVGhlIGxlZ2FjeSBjbG9zZWQgZW51bSBiZWhhdmlvciBpbiBDKysgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2NwcCBmb3IgbW9yZSBpbmZvcm1hdGlvbhJaCgtzdHJpbmdfdHlwZRgCIAEoDjIaLnBiLkNwcEZlYXR1cmVzLlN0cmluZ1R5cGVCKYgBAZgBBJgBAaIBCxIGU1RSSU5HGIQHogEJEgRWSUVXGOkHsgEDCOgHEkwKGmVudW1fbmFtZV91c2VzX3N0cmluZ192aWV3GAMgASgIQiiIAQGYAQaYAQGiAQoSBWZhbHNlGIQHogEJEgR0cnVlGOkHsgEDCOkHIkUKClN0cmluZ1R5cGUSFwoTU1RSSU5HX1RZUEVfVU5LTk9XThAAEggKBFZJRVcQARIICgRDT1JEEAISCgoGU1RSSU5HEAM6PwoDY3BwEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6AcgASgLMg8ucGIuQ3BwRmVhdHVyZXNSA2NwcA", [file_google_protobuf_descriptor]);
22
+ export const file_google_protobuf_cpp_features = /*@__PURE__*/ fileDesc("CiJnb29nbGUvcHJvdG9idWYvY3BwX2ZlYXR1cmVzLnByb3RvEgJwYiKSBQoLQ3BwRmVhdHVyZXMS+wEKEmxlZ2FjeV9jbG9zZWRfZW51bRgBIAEoCELeAYgBAZgBBJgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAbgBCOgHEOgHGq8BVGhlIGxlZ2FjeSBjbG9zZWQgZW51bSBiZWhhdmlvciBpbiBDKysgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2NwcCBmb3IgbW9yZSBpbmZvcm1hdGlvbhJaCgtzdHJpbmdfdHlwZRgCIAEoDjIaLnBiLkNwcEZlYXR1cmVzLlN0cmluZ1R5cGVCKYgBAZgBBJgBAaIBCxIGU1RSSU5HGIQHogEJEgRWSUVXGOkHsgEDCOgHEkwKGmVudW1fbmFtZV91c2VzX3N0cmluZ192aWV3GAMgASgIQiiIAQGYAQaYAQGiAQoSBWZhbHNlGIQHogEJEgR0cnVlGOkHsgEDCOkHElIKDXJlcGVhdGVkX3R5cGUYBCABKA4yHC5wYi5DcHBGZWF0dXJlcy5SZXBlYXRlZFR5cGVCHYgBAZgBBJgBAaIBCxIGTEVHQUNZGIQHsgEDCI9OIkUKClN0cmluZ1R5cGUSFwoTU1RSSU5HX1RZUEVfVU5LTk9XThAAEggKBFZJRVcQARIICgRDT1JEEAISCgoGU1RSSU5HEAMiQAoMUmVwZWF0ZWRUeXBlEhkKFVJFUEVBVEVEX1RZUEVfVU5LTk9XThAAEgoKBkxFR0FDWRABEgkKBVBST1hZEAI6PwoDY3BwEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6AcgASgLMg8ucGIuQ3BwRmVhdHVyZXNSA2NwcA", [file_google_protobuf_descriptor]);
23
23
  /**
24
24
  * Describes the message pb.CppFeatures.
25
25
  * Use `create(CppFeaturesSchema)` to create a new message.
@@ -51,6 +51,34 @@ export var CppFeatures_StringType;
51
51
  * Describes the enum pb.CppFeatures.StringType.
52
52
  */
53
53
  export const CppFeatures_StringTypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_cpp_features, 0, 0);
54
+ /**
55
+ * @generated from enum pb.CppFeatures.RepeatedType
56
+ */
57
+ export var CppFeatures_RepeatedType;
58
+ (function (CppFeatures_RepeatedType) {
59
+ /**
60
+ * @generated from enum value: REPEATED_TYPE_UNKNOWN = 0;
61
+ */
62
+ CppFeatures_RepeatedType[CppFeatures_RepeatedType["REPEATED_TYPE_UNKNOWN"] = 0] = "REPEATED_TYPE_UNKNOWN";
63
+ /**
64
+ * The repeated field will be backed by proto2::Repeated(Ptr)Field, and
65
+ * accessors will return a reference/pointer to this type.
66
+ *
67
+ * @generated from enum value: LEGACY = 1;
68
+ */
69
+ CppFeatures_RepeatedType[CppFeatures_RepeatedType["LEGACY"] = 1] = "LEGACY";
70
+ /**
71
+ * The repeated field has an opaque backing type, and accessors will return
72
+ * a RepeatedFieldProxy.
73
+ *
74
+ * @generated from enum value: PROXY = 2;
75
+ */
76
+ CppFeatures_RepeatedType[CppFeatures_RepeatedType["PROXY"] = 2] = "PROXY";
77
+ })(CppFeatures_RepeatedType || (CppFeatures_RepeatedType = {}));
78
+ /**
79
+ * Describes the enum pb.CppFeatures.RepeatedType.
80
+ */
81
+ export const CppFeatures_RepeatedTypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_cpp_features, 0, 1);
54
82
  /**
55
83
  * @generated from extension: optional pb.CppFeatures cpp = 1000;
56
84
  */
@@ -0,0 +1,30 @@
1
+ // Copyright 2021-2026 Buf Technologies, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { fileDesc } from "../../../codegenv2/file.js";
15
+ import { file_google_protobuf_descriptor } from "./descriptor_pb.js";
16
+ import { messageDesc } from "../../../codegenv2/message.js";
17
+ import { extDesc } from "../../../codegenv2/extension.js";
18
+ /**
19
+ * Describes the file google/protobuf/cpp_file_options.proto.
20
+ */
21
+ export const file_google_protobuf_cpp_file_options = /*@__PURE__*/ fileDesc("CiZnb29nbGUvcHJvdG9idWYvY3BwX2ZpbGVfb3B0aW9ucy5wcm90bxIHcGIuZmlsZSIlCg5DcHBGaWxlT3B0aW9ucxIRCgluYW1lc3BhY2UYASABKAlYATpQCgNjcHASHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMY3gcgASgLMhcucGIuZmlsZS5DcHBGaWxlT3B0aW9uc0IGsgEDCOoHUgNjcHBiCGVkaXRpb25zcOkH", [file_google_protobuf_descriptor]);
22
+ /**
23
+ * Describes the message pb.file.CppFileOptions.
24
+ * Use `create(CppFileOptionsSchema)` to create a new message.
25
+ */
26
+ export const CppFileOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_cpp_file_options, 0);
27
+ /**
28
+ * @generated from extension: pb.file.CppFileOptions cpp = 990;
29
+ */
30
+ export const cpp = /*@__PURE__*/ extDesc(file_google_protobuf_cpp_file_options, 0);
@@ -0,0 +1,19 @@
1
+ // Copyright 2021-2026 Buf Technologies, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { fileDesc } from "../../../codegenv2/file.js";
15
+ import { file_google_protobuf_cpp_file_options } from "./cpp_file_options_pb.js";
16
+ /**
17
+ * Describes the file google/protobuf/cpp_options.proto.
18
+ */
19
+ export const file_google_protobuf_cpp_options = /*@__PURE__*/ fileDesc("CiFnb29nbGUvcHJvdG9idWYvY3BwX29wdGlvbnMucHJvdG8SAnBiUABiCGVkaXRpb25zcOkH", [file_google_protobuf_cpp_file_options]);