bamboo-agents 0.1.17-dev.139.dd4593d → 0.1.17

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.17-dev.139.dd4593d
1
+ 0.1.17
package/dist/index.js CHANGED
@@ -3037,7 +3037,7 @@ var VERSION;
3037
3037
  var init_version = __esm({
3038
3038
  "src/version.ts"() {
3039
3039
  "use strict";
3040
- VERSION = "0.1.17-dev.139.dd4593d";
3040
+ VERSION = "0.1.17";
3041
3041
  }
3042
3042
  });
3043
3043
 
@@ -12517,6 +12517,26 @@ var init_ora = __esm({
12517
12517
  }
12518
12518
  });
12519
12519
 
12520
+ // ../../src/lib/api-contracts/cli/workspace-save-limits.ts
12521
+ function validateSaveRequestBytes(body) {
12522
+ if (Buffer.byteLength(body, "utf-8") > MAX_SAVE_REQUEST_BYTES)
12523
+ throw new SaveTooLargeError();
12524
+ }
12525
+ var MAX_SAVE_FILE_BYTES, MAX_SAVE_REQUEST_BYTES, SAVE_TOO_LARGE_MESSAGE, SaveTooLargeError;
12526
+ var init_workspace_save_limits = __esm({
12527
+ "../../src/lib/api-contracts/cli/workspace-save-limits.ts"() {
12528
+ MAX_SAVE_FILE_BYTES = 3 * 1024 * 1024;
12529
+ MAX_SAVE_REQUEST_BYTES = 33e5;
12530
+ SAVE_TOO_LARGE_MESSAGE = `Each file must be at most ${MAX_SAVE_FILE_BYTES} bytes (3 MiB) raw; the entire encoded request body must be at most ${MAX_SAVE_REQUEST_BYTES} bytes (3.3 MB), including base64 and metadata. Compress oversized files and batch binaries into several saves: binaries first, manifests last.`;
12531
+ SaveTooLargeError = class extends Error {
12532
+ code = "save_too_large";
12533
+ constructor() {
12534
+ super(SAVE_TOO_LARGE_MESSAGE);
12535
+ }
12536
+ };
12537
+ }
12538
+ });
12539
+
12520
12540
  // ../../src/lib/api-contracts/cli/auth-token.ts
12521
12541
  var AuthTokenSuccessSchema, AuthTokenErrorSchema;
12522
12542
  var init_auth_token = __esm({
@@ -16063,6 +16083,8 @@ function userAgent() {
16063
16083
  return `bamboo-agents/${VERSION} (node/${nodeVersion}; ${plat})`;
16064
16084
  }
16065
16085
  async function cliApiFetch(url, init = {}) {
16086
+ if (new URL(url).pathname === "/api/v1/workspace/save" && typeof init.body === "string")
16087
+ validateSaveRequestBytes(init.body);
16066
16088
  const headers = new Headers(init.headers);
16067
16089
  headers.set("User-Agent", userAgent());
16068
16090
  headers.set("Bamboo-CLI-Version", VERSION);
@@ -16829,6 +16851,7 @@ var PROD_DEFAULT_BASE, DEV_DEFAULT_BASE, REQUEST_TIMEOUT_MS, ApiError, operatorE
16829
16851
  var init_api = __esm({
16830
16852
  "src/lib/api.ts"() {
16831
16853
  "use strict";
16854
+ init_workspace_save_limits();
16832
16855
  init_zod();
16833
16856
  init_auth_token();
16834
16857
  init_auth_status();