@alienplatform/sdk 3.3.12 → 3.3.13

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.
package/dist/dist.js CHANGED
@@ -4456,6 +4456,98 @@ const AgentStatusSchema = object({
4456
4456
  * Generated by Kubb (https://kubb.dev/).
4457
4457
  * Do not edit manually.
4458
4458
  */
4459
+ const AiAccessTestSchema = _enum([
4460
+ "verified",
4461
+ "failed",
4462
+ "not-checked"
4463
+ ]);
4464
+ /**
4465
+ * Generated by Kubb (https://kubb.dev/).
4466
+ * Do not edit manually.
4467
+ */
4468
+ const AiAvailabilityBlockerSchema = _enum([
4469
+ "agreement-required",
4470
+ "entitlement-required",
4471
+ "model-activation-required",
4472
+ "deployment-required",
4473
+ "quota-configuration-required",
4474
+ "region-unavailable",
4475
+ "access-denied",
4476
+ "observation-failed"
4477
+ ]);
4478
+ /**
4479
+ * Generated by Kubb (https://kubb.dev/).
4480
+ * Do not edit manually.
4481
+ */
4482
+ /**
4483
+ * @description Provider control plane used to observe model availability without invoking\na model, spending customer quota, or accepting provider terms.
4484
+ */
4485
+ const AiAvailabilitySourceSchema = _enum([
4486
+ "aws-bedrock",
4487
+ "gcp-vertex",
4488
+ "azure-foundry",
4489
+ "anthropic"
4490
+ ]).describe("Provider control plane used to observe model availability without invoking\na model, spending customer quota, or accepting provider terms.");
4491
+ /**
4492
+ * Generated by Kubb (https://kubb.dev/).
4493
+ * Do not edit manually.
4494
+ */
4495
+ const AiModelAvailabilitySchema = _enum([
4496
+ "available",
4497
+ "blocked",
4498
+ "unknown"
4499
+ ]);
4500
+ /**
4501
+ * Generated by Kubb (https://kubb.dev/).
4502
+ * Do not edit manually.
4503
+ */
4504
+ /**
4505
+ * @description A public API accepted from an application client.
4506
+ */
4507
+ const ClientApiSchema = _enum([
4508
+ "open-ai-chat-completions",
4509
+ "open-ai-responses",
4510
+ "anthropic-messages"
4511
+ ]).describe("A public API accepted from an application client.");
4512
+ /**
4513
+ * Generated by Kubb (https://kubb.dev/).
4514
+ * Do not edit manually.
4515
+ */
4516
+ const AiModelAvailabilityObservationSchema = object({
4517
+ get "accessTest"() {
4518
+ return AiAccessTestSchema;
4519
+ },
4520
+ get "availability"() {
4521
+ return AiModelAvailabilitySchema;
4522
+ },
4523
+ get "blockers"() {
4524
+ return array(AiAvailabilityBlockerSchema);
4525
+ },
4526
+ get "clientApis"() {
4527
+ return array(ClientApiSchema.describe("A public API accepted from an application client."));
4528
+ },
4529
+ "errorCode": string().nullish(),
4530
+ "publicModelId": string(),
4531
+ "testedAt": datetime().nullish()
4532
+ });
4533
+ /**
4534
+ * Generated by Kubb (https://kubb.dev/).
4535
+ * Do not edit manually.
4536
+ */
4537
+ const AiAvailabilityObservationSchema = object({
4538
+ "catalogRevision": string(),
4539
+ "location": string().nullish(),
4540
+ get "models"() {
4541
+ return array(AiModelAvailabilityObservationSchema);
4542
+ },
4543
+ get "source"() {
4544
+ return AiAvailabilitySourceSchema.describe("Provider control plane used to observe model availability without invoking\na model, spending customer quota, or accepting provider terms.");
4545
+ }
4546
+ });
4547
+ /**
4548
+ * Generated by Kubb (https://kubb.dev/).
4549
+ * Do not edit manually.
4550
+ */
4459
4551
  const HeartbeatCollectionIssueReasonSchema = _enum([
4460
4552
  "forbidden",
4461
4553
  "not-installed",
@@ -4535,6 +4627,9 @@ const AiHeartbeatStatusSchema = object({
4535
4627
  * Do not edit manually.
4536
4628
  */
4537
4629
  const AwsBedrockAiHeartbeatDataSchema = object({
4630
+ get "availability"() {
4631
+ return AiAvailabilityObservationSchema;
4632
+ },
4538
4633
  "region": string(),
4539
4634
  get "status"() {
4540
4635
  return AiHeartbeatStatusSchema;
@@ -4546,6 +4641,9 @@ const AwsBedrockAiHeartbeatDataSchema = object({
4546
4641
  */
4547
4642
  const AzureFoundryAiHeartbeatDataSchema = object({
4548
4643
  "accountName": string(),
4644
+ get "availability"() {
4645
+ return AiAvailabilityObservationSchema;
4646
+ },
4549
4647
  "endpoint": string().nullish(),
4550
4648
  "location": string().nullish(),
4551
4649
  "resourceGroup": string().nullish(),
@@ -4558,6 +4656,9 @@ const AzureFoundryAiHeartbeatDataSchema = object({
4558
4656
  * Do not edit manually.
4559
4657
  */
4560
4658
  const ExternalAiHeartbeatDataSchema = object({
4659
+ get "availability"() {
4660
+ return union([AiAvailabilityObservationSchema, _null()]).optional();
4661
+ },
4561
4662
  "provider": string().describe("The BYO-key provider serving this binding (e.g. \"openai\"). Used on the Local\nplatform, where the app brings its own provider key instead of an ambient cloud."),
4562
4663
  get "status"() {
4563
4664
  return AiHeartbeatStatusSchema;
@@ -4568,6 +4669,9 @@ const ExternalAiHeartbeatDataSchema = object({
4568
4669
  * Do not edit manually.
4569
4670
  */
4570
4671
  const GcpVertexAiHeartbeatDataSchema = object({
4672
+ get "availability"() {
4673
+ return AiAvailabilityObservationSchema;
4674
+ },
4571
4675
  "location": string(),
4572
4676
  "project": string(),
4573
4677
  get "status"() {
@@ -5598,6 +5702,34 @@ const AwsIamRoleServiceAccountHeartbeatDataSchema = object({
5598
5702
  },
5599
5703
  "tagCount": int().min(0)
5600
5704
  });
5705
+ object({ "keyArn": string().describe("Immutable KMS key ARN. Alias ARNs are not accepted.") }).describe("AWS KMS key created by the customer-installed setup stack.");
5706
+ /**
5707
+ * Generated by Kubb (https://kubb.dev/).
5708
+ * Do not edit manually.
5709
+ */
5710
+ const KeyHeartbeatStatusSchema = object({
5711
+ get "health"() {
5712
+ return ObservedHealthSchema;
5713
+ },
5714
+ get "lifecycle"() {
5715
+ return ProviderLifecycleStateSchema;
5716
+ },
5717
+ "message": string().nullish()
5718
+ });
5719
+ /**
5720
+ * Generated by Kubb (https://kubb.dev/).
5721
+ * Do not edit manually.
5722
+ */
5723
+ const AwsKmsKeyHeartbeatDataSchema = object({
5724
+ "enabled": boolean(),
5725
+ "keyArn": string(),
5726
+ "keySpec": string(),
5727
+ "keyState": string(),
5728
+ "keyUsage": string(),
5729
+ get "status"() {
5730
+ return KeyHeartbeatStatusSchema;
5731
+ }
5732
+ });
5601
5733
  object({
5602
5734
  "tableArn": string().describe("DynamoDB table ARN."),
5603
5735
  "tableName": string().describe("DynamoDB table name.")
@@ -6256,6 +6388,12 @@ object({
6256
6388
  "serverResourceId": string().describe("Full ARM resource id of the Flexible Server (the deletable handle)."),
6257
6389
  "version": string().describe("Engine version the server reports.")
6258
6390
  }).describe("Azure Postgres (Flexible Server + Private Endpoint) registration data: the handles by\nwhich a setup-created Flexible Server (with its Private Endpoint, private DNS zone, and\nthe Key Vault secret holding the master password) is registered as a Frozen Postgres\nresource. Setup owns the server, Alien refreshes and heartbeats it. The raw password is\nnever carried, only the Key Vault secret URI.");
6391
+ object({
6392
+ "keyId": string().describe("Full versioned Key Vault key ID used for new wrapping operations."),
6393
+ "keyName": string().describe("Key name within the vault."),
6394
+ "lineageVersionId": string().describe("Version ID that identifies the original key lineage."),
6395
+ "vaultResourceId": string().describe("ARM resource ID of the dedicated Key Vault.")
6396
+ }).describe("Azure Key Vault key created by the customer-installed setup stack.");
6259
6397
  /**
6260
6398
  * Generated by Kubb (https://kubb.dev/).
6261
6399
  * Do not edit manually.
@@ -6281,6 +6419,20 @@ const AzureKeyVaultHeartbeatDataSchema = object({
6281
6419
  },
6282
6420
  "vaultUri": string().nullish()
6283
6421
  });
6422
+ /**
6423
+ * Generated by Kubb (https://kubb.dev/).
6424
+ * Do not edit manually.
6425
+ */
6426
+ const AzureKeyVaultKeyHeartbeatDataSchema = object({
6427
+ "enabled": boolean().nullish(),
6428
+ "keyId": string(),
6429
+ "keyOperations": array(string()),
6430
+ "keyType": string(),
6431
+ "recoveryLevel": string().nullish(),
6432
+ get "status"() {
6433
+ return KeyHeartbeatStatusSchema;
6434
+ }
6435
+ });
6284
6436
  object({
6285
6437
  "resourceGroup": string().describe("Resource group containing the Storage account."),
6286
6438
  "storageAccountName": string().describe("Storage account name."),
@@ -8271,6 +8423,20 @@ object({
8271
8423
  * Generated by Kubb (https://kubb.dev/).
8272
8424
  * Do not edit manually.
8273
8425
  */
8426
+ const GcpCloudKmsKeyHeartbeatDataSchema = object({
8427
+ "algorithm": string().nullish(),
8428
+ "cryptoKeyName": string(),
8429
+ "primaryState": string().nullish(),
8430
+ "primaryVersion": string().nullish(),
8431
+ "purpose": string(),
8432
+ get "status"() {
8433
+ return KeyHeartbeatStatusSchema;
8434
+ }
8435
+ });
8436
+ /**
8437
+ * Generated by Kubb (https://kubb.dev/).
8438
+ * Do not edit manually.
8439
+ */
8274
8440
  const GcpCloudRunWorkerHeartbeatDataSchema = object({
8275
8441
  "containerImage": string().nullish(),
8276
8442
  "cpuLimit": string().nullish(),
@@ -8360,6 +8526,10 @@ const GcpFirestoreKvHeartbeatDataSchema = object({
8360
8526
  "updateTime": string().nullish(),
8361
8527
  "versionRetentionPeriod": string().nullish()
8362
8528
  });
8529
+ object({
8530
+ "cryptoKeyName": string().describe("Full CryptoKey resource name, without a CryptoKeyVersion."),
8531
+ "primaryVersion": string().describe("Full primary CryptoKeyVersion resource name used for new wrapping operations.")
8532
+ }).describe("GCP Cloud KMS key created by the customer-installed setup stack.");
8363
8533
  object({
8364
8534
  "databaseId": string().describe("Firestore database ID (`(default)` when this is the default database)."),
8365
8535
  "location": string().describe("Firestore database location (region or multi-region code)."),
@@ -8656,6 +8826,60 @@ const ImportedResourceSchema = object({
8656
8826
  * Do not edit manually.
8657
8827
  */
8658
8828
  /**
8829
+ * @description Stable identity of a provider key family.\n\nProvider-native version rotation does not change this value. Replacing the\nprovider key does.
8830
+ */
8831
+ const KeyFingerprintSchema = union([
8832
+ object({
8833
+ "key_arn": string(),
8834
+ "provider": _enum(["aws"])
8835
+ }),
8836
+ object({
8837
+ "crypto_key_name": string(),
8838
+ "provider": _enum(["gcp"])
8839
+ }),
8840
+ object({
8841
+ "key_name": string(),
8842
+ "lineage_version_id": string(),
8843
+ "provider": _enum(["azure"]),
8844
+ "vault_resource_id": string()
8845
+ })
8846
+ ]).describe("Stable identity of a provider key family.\n\nProvider-native version rotation does not change this value. Replacing the\nprovider key does.");
8847
+ /**
8848
+ * Generated by Kubb (https://kubb.dev/).
8849
+ * Do not edit manually.
8850
+ */
8851
+ const KeyHeartbeatDataSchema = union([
8852
+ object({
8853
+ get "data"() {
8854
+ return AwsKmsKeyHeartbeatDataSchema;
8855
+ },
8856
+ "provider": _enum(["aws-kms"])
8857
+ }),
8858
+ object({
8859
+ get "data"() {
8860
+ return GcpCloudKmsKeyHeartbeatDataSchema;
8861
+ },
8862
+ "provider": _enum(["gcp-cloud-kms"])
8863
+ }),
8864
+ object({
8865
+ get "data"() {
8866
+ return AzureKeyVaultKeyHeartbeatDataSchema;
8867
+ },
8868
+ "provider": _enum(["azure-key-vault"])
8869
+ })
8870
+ ]);
8871
+ object({
8872
+ get "fingerprint"() {
8873
+ return KeyFingerprintSchema.describe("Stable identity of a provider key family.\n\nProvider-native version rotation does not change this value. Replacing the\nprovider key does.");
8874
+ },
8875
+ "wrappingKeyId": string().describe("Exact provider key version used for new wrapping operations.")
8876
+ }).describe("Outputs generated by a successfully provisioned Key.");
8877
+ object({ "id": string().describe("Identifier for the key resource.") }).describe("A customer-managed encryption key.");
8878
+ /**
8879
+ * Generated by Kubb (https://kubb.dev/).
8880
+ * Do not edit manually.
8881
+ */
8882
+ /**
8659
8883
  * @description Certificate publication or reference mode for Kubernetes public endpoints.
8660
8884
  */
8661
8885
  const KubernetesCertificateModeSchema = union([
@@ -9645,6 +9869,12 @@ const ResourceHeartbeatDataSchema = union([
9645
9869
  return AiHeartbeatDataSchema;
9646
9870
  },
9647
9871
  "resourceType": _enum(["ai"])
9872
+ }),
9873
+ object({
9874
+ get "data"() {
9875
+ return KeyHeartbeatDataSchema;
9876
+ },
9877
+ "resourceType": _enum(["key"])
9648
9878
  })
9649
9879
  ]);
9650
9880
  object({
@@ -9959,6 +10189,9 @@ array(lazy(() => StorageEventSchema).describe("Represents an event triggered by
9959
10189
  object({ "bucketName": string().describe("The globally unique name of the bucket.") }).describe("Outputs generated by a successfully provisioned Storage bucket.");
9960
10190
  object({
9961
10191
  "corsAllowedOrigins": optional(array(string()).describe("Browser origins allowed to read objects through signed URLs.\n\nWhen non-empty, providers configure CORS for `GET` and `HEAD` requests.\nAn origin of `*` is appropriate for private buckets whose signed URLs\nare bearer credentials and do not use browser cookies.\nDefault: `[]` (CORS disabled).")),
10192
+ get "encryptionKey"() {
10193
+ return union([ResourceRefSchema, _null()]).optional();
10194
+ },
9962
10195
  "id": string().describe("Name of the the storage bucket.\nFor names with dots, each dot-separated label must be ≤ 63 characters."),
9963
10196
  get "lifecycleRules"() {
9964
10197
  return array(LifecycleRuleSchema.describe("Defines a rule for managing the lifecycle of objects within a storage bucket.")).describe("List of rules for automatic object management (e.g., expiration).\nDefault: `[]` (empty list)").optional();
@@ -27988,74 +27988,55 @@ var EventLoop = class {
27988
27988
  }
27989
27989
  };
27990
27990
  //#endregion
27991
- //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.13.0/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js
27991
+ //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.14.0/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js
27992
27992
  /**
27993
27993
  * Read a 64 bit varint as two JS numbers.
27994
27994
  *
27995
- * Returns tuple:
27996
- * [0]: low bits
27997
- * [1]: high bits
27995
+ * Stores the low and high words on the reader.
27998
27996
  *
27999
27997
  * Copyright 2008 Google Inc. All rights reserved.
28000
27998
  *
28001
27999
  * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175
28002
28000
  */
28003
28001
  function varint64read() {
28004
- let lowBits = 0;
28005
- let highBits = 0;
28002
+ const buf = this.buf;
28003
+ let pos = this.pos;
28004
+ let lo = 0;
28005
+ let hi = 0;
28006
28006
  for (let shift = 0; shift < 28; shift += 7) {
28007
- let b = this.buf[this.pos++];
28008
- lowBits |= (b & 127) << shift;
28007
+ const b = buf[pos++];
28008
+ lo |= (b & 127) << shift;
28009
28009
  if ((b & 128) == 0) {
28010
+ this.pos = pos;
28010
28011
  this.assertBounds();
28011
- return [lowBits, highBits];
28012
+ this.varint64Lo = lo;
28013
+ this.varint64Hi = hi;
28014
+ return;
28012
28015
  }
28013
28016
  }
28014
- let middleByte = this.buf[this.pos++];
28015
- lowBits |= (middleByte & 15) << 28;
28016
- highBits = (middleByte & 112) >> 4;
28017
+ const middleByte = buf[pos++];
28018
+ lo |= (middleByte & 15) << 28;
28019
+ hi = (middleByte & 112) >> 4;
28017
28020
  if ((middleByte & 128) == 0) {
28021
+ this.pos = pos;
28018
28022
  this.assertBounds();
28019
- return [lowBits, highBits];
28023
+ this.varint64Lo = lo;
28024
+ this.varint64Hi = hi;
28025
+ return;
28020
28026
  }
28021
28027
  for (let shift = 3; shift <= 31; shift += 7) {
28022
- let b = this.buf[this.pos++];
28023
- highBits |= (b & 127) << shift;
28028
+ const b = buf[pos++];
28029
+ hi |= (b & 127) << shift;
28024
28030
  if ((b & 128) == 0) {
28031
+ this.pos = pos;
28025
28032
  this.assertBounds();
28026
- return [lowBits, highBits];
28033
+ this.varint64Lo = lo;
28034
+ this.varint64Hi = hi;
28035
+ return;
28027
28036
  }
28028
28037
  }
28029
28038
  throw new Error("invalid varint");
28030
28039
  }
28031
- /**
28032
- * Write a 64 bit varint, given as two JS numbers, to the given bytes array.
28033
- *
28034
- * Copyright 2008 Google Inc. All rights reserved.
28035
- *
28036
- * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344
28037
- */
28038
- function varint64write(lo, hi, bytes) {
28039
- for (let i = 0; i < 28; i = i + 7) {
28040
- const shift = lo >>> i;
28041
- const hasNext = !(shift >>> 7 == 0 && hi == 0);
28042
- const byte = (hasNext ? shift | 128 : shift) & 255;
28043
- bytes.push(byte);
28044
- if (!hasNext) return;
28045
- }
28046
- const splitBits = lo >>> 28 & 15 | (hi & 7) << 4;
28047
- const hasMoreBits = !(hi >> 3 == 0);
28048
- bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255);
28049
- if (!hasMoreBits) return;
28050
- for (let i = 3; i < 31; i = i + 7) {
28051
- const shift = hi >>> i;
28052
- const hasNext = !(shift >>> 7 == 0);
28053
- const byte = (hasNext ? shift | 128 : shift) & 255;
28054
- bytes.push(byte);
28055
- if (!hasNext) return;
28056
- }
28057
- bytes.push(hi >>> 31 & 1);
28058
- }
28059
28040
  const TWO_PWR_32_DBL = 4294967296;
28060
28041
  /**
28061
28042
  * Parse decimal string of 64 bit integer value as two JS numbers.
@@ -28158,66 +28139,44 @@ const decimalFrom1e7WithLeadingZeros = (digit1e7) => {
28158
28139
  return "0000000".slice(partial.length) + partial;
28159
28140
  };
28160
28141
  /**
28161
- * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)`
28162
- *
28163
- * Copyright 2008 Google Inc. All rights reserved.
28164
- *
28165
- * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144
28166
- */
28167
- function varint32write(value, bytes) {
28168
- if (value >= 0) {
28169
- while (value > 127) {
28170
- bytes.push(value & 127 | 128);
28171
- value = value >>> 7;
28172
- }
28173
- bytes.push(value);
28174
- } else {
28175
- for (let i = 0; i < 9; i++) {
28176
- bytes.push(value & 127 | 128);
28177
- value = value >> 7;
28178
- }
28179
- bytes.push(1);
28180
- }
28181
- }
28182
- /**
28183
28142
  * Read an unsigned 32 bit varint.
28184
28143
  *
28185
28144
  * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220
28186
28145
  */
28187
28146
  function varint32read() {
28188
28147
  let b = this.buf[this.pos++];
28189
- let result = b & 127;
28190
- if ((b & 128) == 0) {
28148
+ if ((b & 128) === 0) {
28191
28149
  this.assertBounds();
28192
- return result;
28150
+ return b;
28193
28151
  }
28152
+ let result = b & 127;
28194
28153
  b = this.buf[this.pos++];
28195
28154
  result |= (b & 127) << 7;
28196
- if ((b & 128) == 0) {
28155
+ if ((b & 128) === 0) {
28197
28156
  this.assertBounds();
28198
28157
  return result;
28199
28158
  }
28200
28159
  b = this.buf[this.pos++];
28201
28160
  result |= (b & 127) << 14;
28202
- if ((b & 128) == 0) {
28161
+ if ((b & 128) === 0) {
28203
28162
  this.assertBounds();
28204
28163
  return result;
28205
28164
  }
28206
28165
  b = this.buf[this.pos++];
28207
28166
  result |= (b & 127) << 21;
28208
- if ((b & 128) == 0) {
28167
+ if ((b & 128) === 0) {
28209
28168
  this.assertBounds();
28210
28169
  return result;
28211
28170
  }
28212
28171
  b = this.buf[this.pos++];
28213
28172
  result |= (b & 15) << 28;
28214
28173
  for (let readBytes = 5; (b & 128) !== 0 && readBytes < 10; readBytes++) b = this.buf[this.pos++];
28215
- if ((b & 128) != 0) throw new Error("invalid varint");
28174
+ if ((b & 128) !== 0) throw new Error("invalid varint");
28216
28175
  this.assertBounds();
28217
28176
  return result >>> 0;
28218
28177
  }
28219
28178
  //#endregion
28220
- //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.13.0/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js
28179
+ //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.14.0/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js
28221
28180
  /**
28222
28181
  * Int64Support for the current environment.
28223
28182
  */
@@ -28306,23 +28265,41 @@ function assertUInt64String(value) {
28306
28265
  if (!/^[0-9]+$/.test(value)) throw new Error("invalid uint64: " + value);
28307
28266
  }
28308
28267
  //#endregion
28309
- //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.13.0/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js
28268
+ //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.14.0/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js
28310
28269
  const symbol = Symbol.for("@bufbuild/protobuf/text-encoding");
28270
+ /**
28271
+ * Protobuf-ES requires the Text Encoding API to convert UTF-8 from and to
28272
+ * binary. This WHATWG API is widely available, but it is not part of the
28273
+ * ECMAScript standard. On runtimes where it is not available, use this
28274
+ * function to provide your own implementation.
28275
+ *
28276
+ * Providing `encodeUtf8Into` is optional for backwards compatibility. If it
28277
+ * is omitted, we emulate it with a wrapper that calls `encodeUtf8`.
28278
+ *
28279
+ * Note that the Text Encoding API does not provide a way to validate UTF-8.
28280
+ * Our implementation uses String.prototype.isWellFormed, and falls back
28281
+ * to use encodeURIComponent().
28282
+ */
28283
+ function configureTextEncoding(textEncoding) {
28284
+ var _a;
28285
+ globalThis[symbol] = Object.assign(Object.assign({}, textEncoding), { encodeUtf8Into: (_a = textEncoding.encodeUtf8Into) !== null && _a !== void 0 ? _a : emulateEncodeInto(textEncoding.encodeUtf8.bind(textEncoding)) });
28286
+ }
28311
28287
  function getTextEncoding() {
28312
- if (globalThis[symbol] == void 0) {
28313
- const te = new globalThis.TextEncoder();
28314
- const td = new globalThis.TextDecoder();
28315
- let tdStrict;
28316
- globalThis[symbol] = {
28288
+ const globals = globalThis;
28289
+ if (!globals[symbol]) {
28290
+ const textEncoder = new globals.TextEncoder();
28291
+ const textDecoder = new globals.TextDecoder();
28292
+ let textDecoderStrict;
28293
+ const config = {
28317
28294
  encodeUtf8(text) {
28318
- return te.encode(text);
28295
+ return textEncoder.encode(text);
28319
28296
  },
28320
28297
  decodeUtf8(bytes, strict) {
28321
28298
  if (strict) {
28322
- if (tdStrict === void 0) tdStrict = new globalThis.TextDecoder("utf-8", { fatal: true });
28323
- return tdStrict.decode(bytes);
28299
+ if (!textDecoderStrict) textDecoderStrict = new globals.TextDecoder("utf-8", { fatal: true });
28300
+ return textDecoderStrict.decode(bytes);
28324
28301
  }
28325
- return td.decode(bytes);
28302
+ return textDecoder.decode(bytes);
28326
28303
  },
28327
28304
  checkUtf8(text) {
28328
28305
  try {
@@ -28332,11 +28309,29 @@ function getTextEncoding() {
28332
28309
  }
28333
28310
  }
28334
28311
  };
28312
+ if (textEncoder.encodeInto) config.encodeUtf8Into = textEncoder.encodeInto.bind(textEncoder);
28313
+ const nativeStringIsWellFormed = String.prototype.isWellFormed;
28314
+ if (nativeStringIsWellFormed) config.checkUtf8 = (text) => {
28315
+ return nativeStringIsWellFormed.call(text);
28316
+ };
28317
+ configureTextEncoding(config);
28335
28318
  }
28336
- return globalThis[symbol];
28319
+ return globals[symbol];
28320
+ }
28321
+ /**
28322
+ * Simplistic polyfill for encodeUtf8Into.
28323
+ *
28324
+ * @private
28325
+ */
28326
+ function emulateEncodeInto(encodeUtf8) {
28327
+ return (text, dest) => {
28328
+ const bytes = encodeUtf8(text);
28329
+ dest.set(bytes);
28330
+ return { written: bytes.byteLength };
28331
+ };
28337
28332
  }
28338
28333
  //#endregion
28339
- //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.13.0/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js
28334
+ //#region ../../node_modules/.pnpm/@bufbuild+protobuf@2.14.0/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js
28340
28335
  /**
28341
28336
  * Protobuf binary format wire types.
28342
28337
  *
@@ -28400,33 +28395,47 @@ const INT32_MAX = 2147483647;
28400
28395
  */
28401
28396
  const INT32_MIN = -2147483648;
28402
28397
  var BinaryWriter = class {
28403
- constructor(encodeUtf8 = getTextEncoding().encodeUtf8) {
28404
- this.encodeUtf8 = encodeUtf8;
28398
+ constructor(encodeUtf8) {
28405
28399
  /**
28406
- * Previous fork states.
28400
+ * Previous fork positions (the write position at the time
28401
+ * `fork()` was called).
28407
28402
  */
28408
- this.stack = [];
28409
- this.chunks = [];
28410
- this.buf = [];
28403
+ this.stackPos = [];
28404
+ this.encodeUtf8Into = encodeUtf8 ? emulateEncodeInto(encodeUtf8) : getTextEncoding().encodeUtf8Into;
28405
+ this.buffer = EMPTY_BUFFER;
28406
+ this.viewCache = EMPTY_VIEW;
28407
+ this.pos = 0;
28408
+ }
28409
+ ensureCapacity(size) {
28410
+ const required = this.pos + size;
28411
+ if (required > this.buffer.length) {
28412
+ let newLen = this.buffer.length || INITIAL_SIZE;
28413
+ while (newLen < required) newLen *= 2;
28414
+ const newBuf = new Uint8Array(newLen);
28415
+ if (this.pos > 0) newBuf.set(this.buffer);
28416
+ this.buffer = newBuf;
28417
+ }
28418
+ }
28419
+ /**
28420
+ * The DataView over `buffer`, rebuilt only if the buffer has grown since it
28421
+ * was last used.
28422
+ */
28423
+ view() {
28424
+ const bytes = this.buffer;
28425
+ const view = this.viewCache;
28426
+ if (view.byteLength === bytes.byteLength) return view;
28427
+ const newView = new DataView(bytes.buffer);
28428
+ this.viewCache = newView;
28429
+ return newView;
28411
28430
  }
28412
28431
  /**
28413
28432
  * Return all bytes written and reset this writer.
28414
28433
  */
28415
28434
  finish() {
28416
- if (this.buf.length) {
28417
- this.chunks.push(new Uint8Array(this.buf));
28418
- this.buf = [];
28419
- }
28420
- let len = 0;
28421
- for (let i = 0; i < this.chunks.length; i++) len += this.chunks[i].length;
28422
- let bytes = new Uint8Array(len);
28423
- let offset = 0;
28424
- for (let i = 0; i < this.chunks.length; i++) {
28425
- bytes.set(this.chunks[i], offset);
28426
- offset += this.chunks[i].length;
28427
- }
28428
- this.chunks = [];
28429
- return bytes;
28435
+ const result = this.buffer.slice(0, this.pos);
28436
+ this.pos = 0;
28437
+ this.stackPos = [];
28438
+ return result;
28430
28439
  }
28431
28440
  /**
28432
28441
  * Start a new fork for length-delimited data like a message
@@ -28435,12 +28444,9 @@ var BinaryWriter = class {
28435
28444
  * Must be joined later with `join()`.
28436
28445
  */
28437
28446
  fork() {
28438
- this.stack.push({
28439
- chunks: this.chunks,
28440
- buf: this.buf
28441
- });
28442
- this.chunks = [];
28443
- this.buf = [];
28447
+ this.stackPos.push(this.pos);
28448
+ this.ensureCapacity(DEFAULT_LEN_PREFIX_SIZE);
28449
+ this.buffer[this.pos++] = 0;
28444
28450
  return this;
28445
28451
  }
28446
28452
  /**
@@ -28448,13 +28454,18 @@ var BinaryWriter = class {
28448
28454
  * return to the previous state.
28449
28455
  */
28450
28456
  join() {
28451
- let chunk = this.finish();
28452
- let prev = this.stack.pop();
28453
- if (!prev) throw new Error("invalid state, fork stack empty");
28454
- this.chunks = prev.chunks;
28455
- this.buf = prev.buf;
28456
- this.uint32(chunk.byteLength);
28457
- return this.raw(chunk);
28457
+ const forkPos = this.stackPos.pop();
28458
+ if (forkPos === void 0) throw new Error("invalid state, fork stack empty");
28459
+ const len = this.pos - forkPos - DEFAULT_LEN_PREFIX_SIZE;
28460
+ const lenPrefixSize = varint32Size(len);
28461
+ if (lenPrefixSize > DEFAULT_LEN_PREFIX_SIZE) {
28462
+ this.ensureCapacity(lenPrefixSize - DEFAULT_LEN_PREFIX_SIZE);
28463
+ this.buffer.copyWithin(forkPos + lenPrefixSize, forkPos + DEFAULT_LEN_PREFIX_SIZE, this.pos);
28464
+ }
28465
+ this.pos = forkPos;
28466
+ this.uint32(len);
28467
+ this.pos += len;
28468
+ return this;
28458
28469
  }
28459
28470
  /**
28460
28471
  * Writes a tag (field number and wire type).
@@ -28470,11 +28481,9 @@ var BinaryWriter = class {
28470
28481
  * Write a chunk of raw bytes.
28471
28482
  */
28472
28483
  raw(chunk) {
28473
- if (this.buf.length) {
28474
- this.chunks.push(new Uint8Array(this.buf));
28475
- this.buf = [];
28476
- }
28477
- this.chunks.push(chunk);
28484
+ this.ensureCapacity(chunk.length);
28485
+ this.buffer.set(chunk, this.pos);
28486
+ this.pos += chunk.length;
28478
28487
  return this;
28479
28488
  }
28480
28489
  /**
@@ -28482,11 +28491,16 @@ var BinaryWriter = class {
28482
28491
  */
28483
28492
  uint32(value) {
28484
28493
  assertUInt32(value);
28494
+ this.ensureCapacity(5);
28495
+ if (value < 128) {
28496
+ this.buffer[this.pos++] = value;
28497
+ return this;
28498
+ }
28485
28499
  while (value > 127) {
28486
- this.buf.push(value & 127 | 128);
28487
- value = value >>> 7;
28500
+ this.buffer[this.pos++] = value & 127 | 128;
28501
+ value >>>= 7;
28488
28502
  }
28489
- this.buf.push(value);
28503
+ this.buffer[this.pos++] = value;
28490
28504
  return this;
28491
28505
  }
28492
28506
  /**
@@ -28494,14 +28508,21 @@ var BinaryWriter = class {
28494
28508
  */
28495
28509
  int32(value) {
28496
28510
  assertInt32(value);
28497
- varint32write(value, this.buf);
28511
+ if (value >= 0) return this.uint32(value);
28512
+ this.ensureCapacity(10);
28513
+ for (let i = 0; i < 9; i++) {
28514
+ this.buffer[this.pos++] = value & 127 | 128;
28515
+ value >>= 7;
28516
+ }
28517
+ this.buffer[this.pos++] = 1;
28498
28518
  return this;
28499
28519
  }
28500
28520
  /**
28501
28521
  * Write a `bool` value, a varint.
28502
28522
  */
28503
28523
  bool(value) {
28504
- this.buf.push(value ? 1 : 0);
28524
+ this.ensureCapacity(1);
28525
+ this.buffer[this.pos++] = value ? 1 : 0;
28505
28526
  return this;
28506
28527
  }
28507
28528
  /**
@@ -28515,100 +28536,208 @@ var BinaryWriter = class {
28515
28536
  * Write a `string` value, length-delimited data converted to UTF-8 text.
28516
28537
  */
28517
28538
  string(value) {
28518
- let chunk = this.encodeUtf8(value);
28519
- this.uint32(chunk.byteLength);
28520
- return this.raw(chunk);
28539
+ if (typeof value !== "string") value = String(value);
28540
+ const len = value.length;
28541
+ if (len <= ASCII_MAX_LENGTH) {
28542
+ this.ensureCapacity(len + 1);
28543
+ const ascii = this.buffer;
28544
+ let pos = this.pos;
28545
+ ascii[pos++] = len;
28546
+ let i = 0;
28547
+ for (; i < len; i++) {
28548
+ const code = value.charCodeAt(i);
28549
+ if (code > 127) break;
28550
+ ascii[pos++] = code;
28551
+ }
28552
+ if (i == len) {
28553
+ this.pos = pos;
28554
+ return this;
28555
+ }
28556
+ }
28557
+ this.ensureCapacity(len * 3 + 5);
28558
+ const lenPrefixSizeGuess = varint32Size(len);
28559
+ const buf = this.buffer;
28560
+ const start = this.pos;
28561
+ const { written } = this.encodeUtf8Into(value, buf.subarray(start + lenPrefixSizeGuess));
28562
+ const lenPrefixSize = varint32Size(written);
28563
+ if (lenPrefixSize != lenPrefixSizeGuess) buf.copyWithin(start + lenPrefixSize, start + lenPrefixSizeGuess, start + lenPrefixSizeGuess + written);
28564
+ this.uint32(written);
28565
+ this.pos += written;
28566
+ return this;
28521
28567
  }
28522
28568
  /**
28523
28569
  * Write a `float` value, 32-bit floating point number.
28524
28570
  */
28525
28571
  float(value) {
28526
28572
  assertFloat32(value);
28527
- let chunk = /* @__PURE__ */ new Uint8Array(4);
28528
- new DataView(chunk.buffer).setFloat32(0, value, true);
28529
- return this.raw(chunk);
28573
+ this.ensureCapacity(4);
28574
+ this.view().setFloat32(this.pos, value, true);
28575
+ this.pos += 4;
28576
+ return this;
28530
28577
  }
28531
28578
  /**
28532
28579
  * Write a `double` value, a 64-bit floating point number.
28533
28580
  */
28534
28581
  double(value) {
28535
- let chunk = /* @__PURE__ */ new Uint8Array(8);
28536
- new DataView(chunk.buffer).setFloat64(0, value, true);
28537
- return this.raw(chunk);
28582
+ this.ensureCapacity(8);
28583
+ this.view().setFloat64(this.pos, value, true);
28584
+ this.pos += 8;
28585
+ return this;
28538
28586
  }
28539
28587
  /**
28540
28588
  * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
28541
28589
  */
28542
28590
  fixed32(value) {
28543
28591
  assertUInt32(value);
28544
- let chunk = /* @__PURE__ */ new Uint8Array(4);
28545
- new DataView(chunk.buffer).setUint32(0, value, true);
28546
- return this.raw(chunk);
28592
+ this.ensureCapacity(4);
28593
+ this.view().setUint32(this.pos, value, true);
28594
+ this.pos += 4;
28595
+ return this;
28547
28596
  }
28548
28597
  /**
28549
28598
  * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
28550
28599
  */
28551
28600
  sfixed32(value) {
28552
28601
  assertInt32(value);
28553
- let chunk = /* @__PURE__ */ new Uint8Array(4);
28554
- new DataView(chunk.buffer).setInt32(0, value, true);
28555
- return this.raw(chunk);
28602
+ this.ensureCapacity(4);
28603
+ this.view().setInt32(this.pos, value, true);
28604
+ this.pos += 4;
28605
+ return this;
28556
28606
  }
28557
28607
  /**
28558
28608
  * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
28559
28609
  */
28560
28610
  sint32(value) {
28561
28611
  assertInt32(value);
28562
- value = (value << 1 ^ value >> 31) >>> 0;
28563
- varint32write(value, this.buf);
28564
- return this;
28612
+ return this.uint32((value << 1 ^ value >> 31) >>> 0);
28565
28613
  }
28566
28614
  /**
28567
28615
  * Write a `sfixed64` value, a signed, fixed-length 64-bit integer.
28568
28616
  */
28569
28617
  sfixed64(value) {
28570
- let chunk = /* @__PURE__ */ new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.enc(value);
28571
- view.setInt32(0, tc.lo, true);
28572
- view.setInt32(4, tc.hi, true);
28573
- return this.raw(chunk);
28618
+ const tc = protoInt64.enc(value);
28619
+ this.ensureCapacity(8);
28620
+ const view = this.view();
28621
+ view.setInt32(this.pos, tc.lo, true);
28622
+ view.setInt32(this.pos + 4, tc.hi, true);
28623
+ this.pos += 8;
28624
+ return this;
28574
28625
  }
28575
28626
  /**
28576
28627
  * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.
28577
28628
  */
28578
28629
  fixed64(value) {
28579
- let chunk = /* @__PURE__ */ new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.uEnc(value);
28580
- view.setInt32(0, tc.lo, true);
28581
- view.setInt32(4, tc.hi, true);
28582
- return this.raw(chunk);
28630
+ const tc = protoInt64.uEnc(value);
28631
+ this.ensureCapacity(8);
28632
+ const view = this.view();
28633
+ view.setInt32(this.pos, tc.lo, true);
28634
+ view.setInt32(this.pos + 4, tc.hi, true);
28635
+ this.pos += 8;
28636
+ return this;
28583
28637
  }
28584
28638
  /**
28585
28639
  * Write a `int64` value, a signed 64-bit varint.
28586
28640
  */
28587
28641
  int64(value) {
28588
- let tc = protoInt64.enc(value);
28589
- varint64write(tc.lo, tc.hi, this.buf);
28590
- return this;
28642
+ const tc = protoInt64.enc(value);
28643
+ return this.writeVarint64(tc.lo, tc.hi);
28591
28644
  }
28592
28645
  /**
28593
28646
  * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
28594
28647
  */
28595
28648
  sint64(value) {
28596
- const tc = protoInt64.enc(value), sign = tc.hi >> 31;
28597
- varint64write(tc.lo << 1 ^ sign, (tc.hi << 1 | tc.lo >>> 31) ^ sign, this.buf);
28598
- return this;
28649
+ const tc = protoInt64.enc(value), sign = tc.hi >> 31, lo = tc.lo << 1 ^ sign, hi = (tc.hi << 1 | tc.lo >>> 31) ^ sign;
28650
+ return this.writeVarint64(lo, hi);
28599
28651
  }
28600
28652
  /**
28601
28653
  * Write a `uint64` value, an unsigned 64-bit varint.
28602
28654
  */
28603
28655
  uint64(value) {
28604
28656
  const tc = protoInt64.uEnc(value);
28605
- varint64write(tc.lo, tc.hi, this.buf);
28657
+ return this.writeVarint64(tc.lo, tc.hi);
28658
+ }
28659
+ /**
28660
+ * Write a 64-bit varint directly into the buffer. Accepts the value as
28661
+ * split low/high 32-bit words.
28662
+ *
28663
+ * Ported from varint64write() to avoid the intermediate number[] buffer.
28664
+ * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344
28665
+ */
28666
+ writeVarint64(lo, hi) {
28667
+ this.ensureCapacity(10);
28668
+ const buf = this.buffer;
28669
+ let pos = this.pos;
28670
+ for (let i = 0; i < 28; i = i + 7) {
28671
+ const shift = lo >>> i;
28672
+ const hasNext = !(shift >>> 7 == 0 && hi == 0);
28673
+ buf[pos++] = (hasNext ? shift | 128 : shift) & 255;
28674
+ if (!hasNext) {
28675
+ this.pos = pos;
28676
+ return this;
28677
+ }
28678
+ }
28679
+ const splitBits = lo >>> 28 & 15 | (hi & 7) << 4;
28680
+ const hasMoreBits = !(hi >> 3 == 0);
28681
+ buf[pos++] = (hasMoreBits ? splitBits | 128 : splitBits) & 255;
28682
+ if (!hasMoreBits) {
28683
+ this.pos = pos;
28684
+ return this;
28685
+ }
28686
+ for (let i = 3; i < 31; i = i + 7) {
28687
+ const shift = hi >>> i;
28688
+ const hasNext = !(shift >>> 7 == 0);
28689
+ buf[pos++] = (hasNext ? shift | 128 : shift) & 255;
28690
+ if (!hasNext) {
28691
+ this.pos = pos;
28692
+ return this;
28693
+ }
28694
+ }
28695
+ buf[pos++] = hi >>> 31 & 1;
28696
+ this.pos = pos;
28606
28697
  return this;
28607
28698
  }
28608
28699
  };
28700
+ /**
28701
+ * Capacity of the buffer allocated by the first write..
28702
+ */
28703
+ const INITIAL_SIZE = 128;
28704
+ /**
28705
+ * Bytes `fork()` reserves for the length prefix, betting that the payload will
28706
+ * be under 128 bytes. `join()` fills them in, and widens them if the bet was
28707
+ * wrong.
28708
+ */
28709
+ const DEFAULT_LEN_PREFIX_SIZE = 1;
28710
+ /**
28711
+ * Shared empty buffer used as the initial value before the first write.
28712
+ * Avoids allocating and zeroing `INITIAL_SIZE` bytes per BinaryWriter when a
28713
+ * writer is only used for a tiny message (or not used at all).
28714
+ */
28715
+ const EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array(0);
28716
+ /**
28717
+ * Shared empty view, paired with `EMPTY_BUFFER`. Never written to: any
28718
+ * fixed-width write first grows the buffer, which replaces this view.
28719
+ */
28720
+ const EMPTY_VIEW = new DataView(EMPTY_BUFFER.buffer);
28721
+ /**
28722
+ * Longest string on the ASCII fast paths. Must stay below 0x80, so
28723
+ * that the writer's length prefix always fits a single varint byte.
28724
+ */
28725
+ const ASCII_MAX_LENGTH = 32;
28726
+ /**
28727
+ * Number of bytes needed to encode `value` as an unsigned 32-bit varint.
28728
+ */
28729
+ function varint32Size(value) {
28730
+ if (value < 128) return 1;
28731
+ if (value < 16384) return 2;
28732
+ if (value < 2097152) return 3;
28733
+ if (value < 268435456) return 4;
28734
+ return 5;
28735
+ }
28609
28736
  var BinaryReader = class {
28610
28737
  constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) {
28611
28738
  this.decodeUtf8 = decodeUtf8;
28739
+ this.varint64Lo = 0;
28740
+ this.varint64Hi = 0;
28612
28741
  this.varint64 = varint64read;
28613
28742
  /**
28614
28743
  * Read a `uint32` field, an unsigned 32 bit varint.
@@ -28694,19 +28823,23 @@ var BinaryReader = class {
28694
28823
  * Read a `int64` field, a signed 64-bit varint.
28695
28824
  */
28696
28825
  int64() {
28697
- return protoInt64.dec(...this.varint64());
28826
+ this.varint64();
28827
+ return protoInt64.dec(this.varint64Lo, this.varint64Hi);
28698
28828
  }
28699
28829
  /**
28700
28830
  * Read a `uint64` field, an unsigned 64-bit varint.
28701
28831
  */
28702
28832
  uint64() {
28703
- return protoInt64.uDec(...this.varint64());
28833
+ this.varint64();
28834
+ return protoInt64.uDec(this.varint64Lo, this.varint64Hi);
28704
28835
  }
28705
28836
  /**
28706
28837
  * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
28707
28838
  */
28708
28839
  sint64() {
28709
- let [lo, hi] = this.varint64();
28840
+ this.varint64();
28841
+ let lo = this.varint64Lo;
28842
+ let hi = this.varint64Hi;
28710
28843
  let s = -(lo & 1);
28711
28844
  lo = (lo >>> 1 | (hi & 1) << 31) ^ s;
28712
28845
  hi = hi >>> 1 ^ s;
@@ -28716,8 +28849,13 @@ var BinaryReader = class {
28716
28849
  * Read a `bool` field, a variant.
28717
28850
  */
28718
28851
  bool() {
28719
- let [lo, hi] = this.varint64();
28720
- return lo !== 0 || hi !== 0;
28852
+ const b = this.buf[this.pos];
28853
+ if (b < 128) {
28854
+ this.pos++;
28855
+ return b !== 0;
28856
+ }
28857
+ this.varint64();
28858
+ return this.varint64Lo !== 0 || this.varint64Hi !== 0;
28721
28859
  }
28722
28860
  /**
28723
28861
  * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.
@@ -28769,7 +28907,18 @@ var BinaryReader = class {
28769
28907
  * `strict` is true, throw on invalid UTF-8 instead of substituting U+FFFD.
28770
28908
  */
28771
28909
  string(strict) {
28772
- return this.decodeUtf8(this.bytes(), strict);
28910
+ const bytes = this.bytes();
28911
+ const len = bytes.length;
28912
+ if (len <= ASCII_MAX_LENGTH) {
28913
+ const codes = new Array(len);
28914
+ for (let i = 0; i < len; i++) {
28915
+ const byte = bytes[i];
28916
+ if (byte > 127) return this.decodeUtf8(bytes, strict);
28917
+ codes[i] = byte;
28918
+ }
28919
+ return String.fromCharCode.apply(String, codes);
28920
+ }
28921
+ return this.decodeUtf8(bytes, strict);
28773
28922
  }
28774
28923
  };
28775
28924
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alienplatform/sdk",
3
- "version": "3.3.12",
3
+ "version": "3.3.13",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -57,9 +57,9 @@
57
57
  "nice-grpc": "^2.1.11",
58
58
  "nice-grpc-common": "^2.0.2",
59
59
  "zod": "4.4.3",
60
- "@alienplatform/ai-gateway": "^3.3.12",
61
- "@alienplatform/bindings": "^3.3.12",
62
- "@alienplatform/core": "^3.3.12"
60
+ "@alienplatform/ai-gateway": "^3.3.13",
61
+ "@alienplatform/bindings": "^3.3.13",
62
+ "@alienplatform/core": "^3.3.13"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "tsdown && tsc --emitDeclarationOnly",