@kubb/studio 5.9.6 → 5.10.1
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/README.md +2 -1
- package/dist/index.cjs +9 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/{protocol-ixLkhvRJ.d.ts → protocol-C1PwN9fa.d.ts} +9 -2
- package/dist/protocol.cjs +3 -0
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.ts +2 -2
- package/dist/protocol.js +3 -1
- package/dist/protocol.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -107,7 +107,8 @@ Every permission is off by default, and each covers one trust boundary:
|
|
|
107
107
|
| `allowWrite` | Generated files are written to disk. Off means they exist only in memory and stream to Studio. |
|
|
108
108
|
| `allowExec` | The formatter, the linter, and `output.postGenerate` run as child processes. |
|
|
109
109
|
| `allowConfigEdit` | Studio may change plugin options in `kubb.config.ts`. |
|
|
110
|
-
| `allowRead` | Studio may read back the files a generation produced
|
|
110
|
+
| `allowRead` | Studio may read back the files a generation produced. |
|
|
111
|
+
| `allowReadAst` | Studio may read back the parsed spec (the Kubb AST). |
|
|
111
112
|
|
|
112
113
|
A sandbox never writes or edits config, and always allows reads.
|
|
113
114
|
|
package/dist/index.cjs
CHANGED
|
@@ -177,7 +177,7 @@ function getElapsedMs(hrStart) {
|
|
|
177
177
|
}
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region package.json
|
|
180
|
-
var version = "5.
|
|
180
|
+
var version = "5.10.1";
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region src/resolveConfig.ts
|
|
183
183
|
/**
|
|
@@ -1606,7 +1606,8 @@ var Agent = class extends capnweb.RpcTarget {
|
|
|
1606
1606
|
...permissions,
|
|
1607
1607
|
allowWrite: false,
|
|
1608
1608
|
allowConfigEdit: false,
|
|
1609
|
-
allowRead: true
|
|
1609
|
+
allowRead: true,
|
|
1610
|
+
allowReadAst: true
|
|
1610
1611
|
} : permissions;
|
|
1611
1612
|
}
|
|
1612
1613
|
get #generations() {
|
|
@@ -1816,7 +1817,7 @@ var Agent = class extends capnweb.RpcTarget {
|
|
|
1816
1817
|
});
|
|
1817
1818
|
const inputBytes = await this.#generations.keepInput({
|
|
1818
1819
|
jobId,
|
|
1819
|
-
input: this.#permissions.
|
|
1820
|
+
input: this.#permissions.allowReadAst ? files.input : null,
|
|
1820
1821
|
maxSetMb: this.#limits.maxMb
|
|
1821
1822
|
});
|
|
1822
1823
|
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" });
|
|
@@ -1877,13 +1878,13 @@ var Agent = class extends capnweb.RpcTarget {
|
|
|
1877
1878
|
}
|
|
1878
1879
|
}
|
|
1879
1880
|
/**
|
|
1880
|
-
* Returns the Kubb AST a kept job parsed its spec into. Refused without `
|
|
1881
|
+
* Returns the Kubb AST a kept job parsed its spec into. Refused without `allowReadAst`.
|
|
1881
1882
|
*/
|
|
1882
1883
|
async readInput(input) {
|
|
1883
1884
|
this.#assertConnected();
|
|
1884
|
-
if (!this.#permissions.
|
|
1885
|
-
message: require_protocol.
|
|
1886
|
-
permission: "
|
|
1885
|
+
if (!this.#permissions.allowReadAst) return this.#refuse({
|
|
1886
|
+
message: require_protocol.READ_AST_NOT_ALLOWED_MESSAGE,
|
|
1887
|
+
permission: "allowReadAst"
|
|
1887
1888
|
});
|
|
1888
1889
|
if (typeof input.jobId !== "string" || !input.jobId) return this.#refuse({ message: "The request must name a job" });
|
|
1889
1890
|
const generation = await this.#generations.get(input.jobId);
|
|
@@ -2019,6 +2020,7 @@ async function runAgent({ options, openRpc }) {
|
|
|
2019
2020
|
allowConfigEdit: false,
|
|
2020
2021
|
allowExec: false,
|
|
2021
2022
|
allowRead: false,
|
|
2023
|
+
allowReadAst: false,
|
|
2022
2024
|
...options.permissions
|
|
2023
2025
|
},
|
|
2024
2026
|
hooks: options.hooks ?? new _kubb_core.Hookable(),
|