@odla-ai/cli 0.40.0 → 0.40.2
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/bin.cjs +20 -13
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-2IHE5U3M.js → chunk-XUTMQMXZ.js} +20 -13
- package/dist/chunk-XUTMQMXZ.js.map +1 -0
- package/dist/{cli-LRJBESE6.js → cli-WJSQEBDO.js} +2 -2
- package/dist/index.cjs +19 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2IHE5U3M.js.map +0 -1
- /package/dist/{cli-LRJBESE6.js.map → cli-WJSQEBDO.js.map} +0 -0
package/dist/bin.js
CHANGED
|
@@ -174,7 +174,7 @@ function absoluteEntryPath(entryPath) {
|
|
|
174
174
|
|
|
175
175
|
// src/bin.ts
|
|
176
176
|
var argv = process.argv.slice(2);
|
|
177
|
-
requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-
|
|
177
|
+
requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-WJSQEBDO.js")).runCli()).catch((err) => {
|
|
178
178
|
console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
|
|
179
179
|
process.exitCode = exitCodeFor(err);
|
|
180
180
|
});
|
|
@@ -6145,7 +6145,7 @@ async function stageWorkspacePair(baselineSource, workspaceSource, options = {})
|
|
|
6145
6145
|
}
|
|
6146
6146
|
}
|
|
6147
6147
|
|
|
6148
|
-
// ../harness/dist/chunk-
|
|
6148
|
+
// ../harness/dist/chunk-L2T3LPEF.js
|
|
6149
6149
|
import { createHash as createHash3 } from "crypto";
|
|
6150
6150
|
import { readFile as readFile2, readdir as readdir2 } from "fs/promises";
|
|
6151
6151
|
import { relative as relative4, resolve as resolve10 } from "path";
|
|
@@ -6482,7 +6482,7 @@ function validateSnapshot(snapshot, limits) {
|
|
|
6482
6482
|
}
|
|
6483
6483
|
}
|
|
6484
6484
|
|
|
6485
|
-
// ../harness/dist/chunk-
|
|
6485
|
+
// ../harness/dist/chunk-L2T3LPEF.js
|
|
6486
6486
|
import { spawn as spawn4 } from "child_process";
|
|
6487
6487
|
import { lstat as lstat2 } from "fs/promises";
|
|
6488
6488
|
import { resolve as resolve23, sep as sep3 } from "path";
|
|
@@ -6787,7 +6787,7 @@ function looksLikeDestination(value2) {
|
|
|
6787
6787
|
return /^(?:[a-z][a-z0-9+.-]*:\/\/|\/|\\\\)/i.test(text3) || /^[\w.-]+\.[a-z]{2,}(?:[/:]|$)/i.test(text3);
|
|
6788
6788
|
}
|
|
6789
6789
|
|
|
6790
|
-
// ../harness/dist/chunk-
|
|
6790
|
+
// ../harness/dist/chunk-L2T3LPEF.js
|
|
6791
6791
|
import { readFile as readFile4, stat as stat2 } from "fs/promises";
|
|
6792
6792
|
import { readFile as readFile3 } from "fs/promises";
|
|
6793
6793
|
import { join as join33 } from "path";
|
|
@@ -7055,7 +7055,7 @@ async function buildCodeGraph(input) {
|
|
|
7055
7055
|
return builder.build();
|
|
7056
7056
|
}
|
|
7057
7057
|
|
|
7058
|
-
// ../harness/dist/chunk-
|
|
7058
|
+
// ../harness/dist/chunk-L2T3LPEF.js
|
|
7059
7059
|
import { createHash as createHash32 } from "crypto";
|
|
7060
7060
|
async function digestStagedWorkspace(root, limits) {
|
|
7061
7061
|
const files = [];
|
|
@@ -7314,6 +7314,7 @@ function parseSnapshot(value2) {
|
|
|
7314
7314
|
return { host, bindings, commands };
|
|
7315
7315
|
}
|
|
7316
7316
|
async function parseSource(value2) {
|
|
7317
|
+
const repositoryLimits = { maximumFiles: 1e5, maximumBytes: 80 * 1024 * 1024 };
|
|
7317
7318
|
const snapshot = record5(record5(value2)?.snapshot);
|
|
7318
7319
|
if (!snapshot || typeof snapshot.repository !== "string" || typeof snapshot.commitSha !== "string" || typeof snapshot.treeDigest !== "string" || !Array.isArray(snapshot.files)) throw invalid("source");
|
|
7319
7320
|
const files = snapshot.files.map((value22) => {
|
|
@@ -7335,12 +7336,12 @@ async function parseSource(value2) {
|
|
|
7335
7336
|
return { path: file.path, content: file.content };
|
|
7336
7337
|
});
|
|
7337
7338
|
const source2 = { repository: reference.repository, commitSha: reference.commitSha, files: referenceFiles };
|
|
7338
|
-
const referenceDigest = await digestCodeRepositorySnapshot(source2,
|
|
7339
|
+
const referenceDigest = await digestCodeRepositorySnapshot(source2, repositoryLimits);
|
|
7339
7340
|
if (referenceDigest !== reference.treeDigest) throw invalid("reference source digest");
|
|
7340
7341
|
references.push({ alias: reference.alias, ...source2, treeDigest: referenceDigest });
|
|
7341
7342
|
}
|
|
7342
7343
|
const source = { repository: snapshot.repository, commitSha: snapshot.commitSha, files };
|
|
7343
|
-
const digest = await digestCodeRepositorySnapshot(source,
|
|
7344
|
+
const digest = await digestCodeRepositorySnapshot(source, repositoryLimits);
|
|
7344
7345
|
if (digest !== snapshot.treeDigest) throw invalid("source digest");
|
|
7345
7346
|
return { ...source, treeDigest: digest, ...references.length ? { references } : {} };
|
|
7346
7347
|
}
|
|
@@ -7992,8 +7993,11 @@ async function prepareRuntimeLocalSource(input) {
|
|
|
7992
7993
|
}
|
|
7993
7994
|
var RESERVED2 = /* @__PURE__ */ new Set([".git", ".odla", ".wrangler", "node_modules", "dist", "coverage"]);
|
|
7994
7995
|
var SECRET2 = /^(?:\.env(?:\..+)?|\.dev\.vars|credentials(?:\..+)?\.json|dev-token(?:\..+)?\.json)$/i;
|
|
7996
|
+
var SOURCE_MAX_FILES = 1e5;
|
|
7997
|
+
var SOURCE_MAX_BYTES = 80 * 1024 * 1024;
|
|
7998
|
+
var SOURCE_SET_MAX_BYTES = 480 * 1024 * 1024;
|
|
7995
7999
|
async function materializeCodeRuntimeSource(snapshot, tempRoot = tmpdir3()) {
|
|
7996
|
-
if (!snapshot.files.length || snapshot.files.length >
|
|
8000
|
+
if (!snapshot.files.length || snapshot.files.length > SOURCE_MAX_FILES) throw new TypeError("Code source file count is invalid");
|
|
7997
8001
|
const root = await mkdtemp3(join23(tempRoot, "odla-code-source-"));
|
|
7998
8002
|
const sourceDir = join23(root, "source");
|
|
7999
8003
|
await mkdir3(sourceDir);
|
|
@@ -8005,7 +8009,7 @@ async function materializeCodeRuntimeSource(snapshot, tempRoot = tmpdir3()) {
|
|
|
8005
8009
|
if (seen.has(file.path)) throw new TypeError("Code source repeats a path");
|
|
8006
8010
|
seen.add(file.path);
|
|
8007
8011
|
bytes += Buffer.byteLength(file.path) + Buffer.byteLength(file.content);
|
|
8008
|
-
if (bytes >
|
|
8012
|
+
if (bytes > SOURCE_MAX_BYTES) throw new TypeError("Code source exceeds its byte bound");
|
|
8009
8013
|
const target = resolve32(sourceDir, file.path);
|
|
8010
8014
|
if (!target.startsWith(`${resolve32(sourceDir)}${sep23}`)) throw new TypeError("Code source path escapes its root");
|
|
8011
8015
|
await mkdir3(dirname10(target), { recursive: true });
|
|
@@ -8013,14 +8017,14 @@ async function materializeCodeRuntimeSource(snapshot, tempRoot = tmpdir3()) {
|
|
|
8013
8017
|
}
|
|
8014
8018
|
for (const reference of snapshot.references ?? []) {
|
|
8015
8019
|
validateAlias(reference.alias);
|
|
8016
|
-
if (!reference.files.length || reference.files.length >
|
|
8020
|
+
if (!reference.files.length || reference.files.length > SOURCE_MAX_FILES) throw new TypeError("Code reference file count is invalid");
|
|
8017
8021
|
for (const file of reference.files) {
|
|
8018
8022
|
validatePath(file.path);
|
|
8019
8023
|
const path = `.odla-references/${reference.alias}/${file.path}`;
|
|
8020
8024
|
if (seen.has(path)) throw new TypeError("Code reference repeats a path");
|
|
8021
8025
|
seen.add(path);
|
|
8022
8026
|
bytes += Buffer.byteLength(path) + Buffer.byteLength(file.content);
|
|
8023
|
-
if (bytes >
|
|
8027
|
+
if (bytes > SOURCE_SET_MAX_BYTES) throw new TypeError("Code source set exceeds its byte bound");
|
|
8024
8028
|
const target = resolve32(sourceDir, path);
|
|
8025
8029
|
if (!target.startsWith(`${resolve32(sourceDir)}${sep23}`)) throw new TypeError("Code reference path escapes its root");
|
|
8026
8030
|
await mkdir3(dirname10(target), { recursive: true });
|
|
@@ -8046,7 +8050,7 @@ async function attachCodeRuntimeReferences(workspace, references) {
|
|
|
8046
8050
|
validatePath(file.path);
|
|
8047
8051
|
const path = `.odla-references/${reference.alias}/${file.path}`;
|
|
8048
8052
|
bytes += Buffer.byteLength(path) + Buffer.byteLength(file.content);
|
|
8049
|
-
if (bytes >
|
|
8053
|
+
if (bytes > SOURCE_SET_MAX_BYTES - SOURCE_MAX_BYTES) throw new TypeError("Code reference set exceeds its byte bound");
|
|
8050
8054
|
for (const root of [workspace.baselineDir, workspace.workspaceDir]) {
|
|
8051
8055
|
const target = resolve32(root, path);
|
|
8052
8056
|
if (!target.startsWith(`${resolve32(root)}${sep23}`)) throw new TypeError("Code reference path escapes its root");
|
|
@@ -8096,7 +8100,10 @@ async function materializeCommandWorkspace(input) {
|
|
|
8096
8100
|
trustedBaseDir: materialized.sourceDir,
|
|
8097
8101
|
trustedBaseCommitSha: source.commitSha,
|
|
8098
8102
|
checkpoint: codeCheckpointPayload(command.payload)
|
|
8099
|
-
})).workspace : await stageWorkspace(materialized.sourceDir
|
|
8103
|
+
})).workspace : await stageWorkspace(materialized.sourceDir, {
|
|
8104
|
+
maxFiles: SOURCE_MAX_FILES,
|
|
8105
|
+
maxBytes: SOURCE_SET_MAX_BYTES
|
|
8106
|
+
});
|
|
8100
8107
|
return { workspace, sourceDigest: source.treeDigest, requestedLocal: null };
|
|
8101
8108
|
} finally {
|
|
8102
8109
|
await materialized.cleanup();
|
|
@@ -15792,4 +15799,4 @@ export {
|
|
|
15792
15799
|
isTerminalHostedSecurityStatus,
|
|
15793
15800
|
runCli
|
|
15794
15801
|
};
|
|
15795
|
-
//# sourceMappingURL=chunk-
|
|
15802
|
+
//# sourceMappingURL=chunk-XUTMQMXZ.js.map
|