@kubb/studio 5.9.5 → 5.10.0

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-CRm0XQPb.js";
2
- import { M as PublishedSnapshot, V as SnapshotUploadMetadata, a as AgentConnectInfo, c as ConfigEdit, l as ConfigEditOutcome, o as AgentPermissions, w as InstalledExtensions } from "./protocol-ixLkhvRJ.js";
2
+ import { H as SnapshotUploadMetadata, M as PublishedSnapshot, a as AgentConnectInfo, c as ConfigEdit, l as ConfigEditOutcome, o as AgentPermissions, w as InstalledExtensions } from "./protocol-C1PwN9fa.js";
3
3
  import { Config, Hookable, KubbHooks } from "@kubb/core";
4
4
  //#region src/connect.d.ts
5
5
  /**
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./rolldown-runtime-CRm0XQPb.js";
2
- import { AGENT_INSTANCE_HEADER, AGENT_SOCKET_PATH, AgentCloseCode, GENERATION_GONE_MESSAGE, MAX_PAGE_LINES, MAX_SNAPSHOT_BYTES, NO_INPUT_MESSAGE, READ_NOT_ALLOWED_MESSAGE, generationEventTypes } from "./protocol.js";
2
+ import { AGENT_INSTANCE_HEADER, AGENT_SOCKET_PATH, AgentCloseCode, GENERATION_GONE_MESSAGE, MAX_PAGE_LINES, MAX_SNAPSHOT_BYTES, NO_INPUT_MESSAGE, READ_AST_NOT_ALLOWED_MESSAGE, READ_NOT_ALLOWED_MESSAGE, generationEventTypes } from "./protocol.js";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash, hash, randomUUID } from "node:crypto";
5
5
  import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
@@ -153,7 +153,7 @@ function getElapsedMs(hrStart) {
153
153
  }
154
154
  //#endregion
155
155
  //#region package.json
156
- var version = "5.9.5";
156
+ var version = "5.10.0";
157
157
  //#endregion
158
158
  //#region src/resolveConfig.ts
159
159
  /**
@@ -1582,7 +1582,8 @@ var Agent = class extends RpcTarget {
1582
1582
  ...permissions,
1583
1583
  allowWrite: false,
1584
1584
  allowConfigEdit: false,
1585
- allowRead: true
1585
+ allowRead: true,
1586
+ allowReadAst: true
1586
1587
  } : permissions;
1587
1588
  }
1588
1589
  get #generations() {
@@ -1792,7 +1793,7 @@ var Agent = class extends RpcTarget {
1792
1793
  });
1793
1794
  const inputBytes = await this.#generations.keepInput({
1794
1795
  jobId,
1795
- input: this.#permissions.allowRead ? files.input : null,
1796
+ input: this.#permissions.allowReadAst ? files.input : null,
1796
1797
  maxSetMb: this.#limits.maxMb
1797
1798
  });
1798
1799
  if (!output.paths.length && Object.keys(output.hashes).length) await this.#warn({ message: "Kept only the hashes of this generation: its output is too large to keep" });
@@ -1853,13 +1854,13 @@ var Agent = class extends RpcTarget {
1853
1854
  }
1854
1855
  }
1855
1856
  /**
1856
- * Returns the Kubb AST a kept job parsed its spec into. Refused without `allowRead`.
1857
+ * Returns the Kubb AST a kept job parsed its spec into. Refused without `allowReadAst`.
1857
1858
  */
1858
1859
  async readInput(input) {
1859
1860
  this.#assertConnected();
1860
- if (!this.#permissions.allowRead) return this.#refuse({
1861
- message: READ_NOT_ALLOWED_MESSAGE,
1862
- permission: "allowRead"
1861
+ if (!this.#permissions.allowReadAst) return this.#refuse({
1862
+ message: READ_AST_NOT_ALLOWED_MESSAGE,
1863
+ permission: "allowReadAst"
1863
1864
  });
1864
1865
  if (typeof input.jobId !== "string" || !input.jobId) return this.#refuse({ message: "The request must name a job" });
1865
1866
  const generation = await this.#generations.get(input.jobId);
@@ -1995,6 +1996,7 @@ async function runAgent({ options, openRpc }) {
1995
1996
  allowConfigEdit: false,
1996
1997
  allowExec: false,
1997
1998
  allowRead: false,
1999
+ allowReadAst: false,
1998
2000
  ...options.permissions
1999
2001
  },
2000
2002
  hooks: options.hooks ?? new Hookable(),