@odla-ai/cli 0.40.0 → 0.40.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/dist/bin.cjs CHANGED
@@ -7915,7 +7915,7 @@ var init_code2 = __esm({
7915
7915
  }
7916
7916
  });
7917
7917
 
7918
- // ../harness/dist/chunk-UVGZHNLW.js
7918
+ // ../harness/dist/chunk-L2T3LPEF.js
7919
7919
  async function digestStagedWorkspace(root, limits) {
7920
7920
  const files = [];
7921
7921
  const walk = async (directory) => {
@@ -8132,6 +8132,7 @@ function parseSnapshot(value2) {
8132
8132
  return { host, bindings, commands };
8133
8133
  }
8134
8134
  async function parseSource(value2) {
8135
+ const repositoryLimits = { maximumFiles: 1e5, maximumBytes: 80 * 1024 * 1024 };
8135
8136
  const snapshot = record5(record5(value2)?.snapshot);
8136
8137
  if (!snapshot || typeof snapshot.repository !== "string" || typeof snapshot.commitSha !== "string" || typeof snapshot.treeDigest !== "string" || !Array.isArray(snapshot.files)) throw invalid("source");
8137
8138
  const files = snapshot.files.map((value22) => {
@@ -8153,12 +8154,12 @@ async function parseSource(value2) {
8153
8154
  return { path: file.path, content: file.content };
8154
8155
  });
8155
8156
  const source2 = { repository: reference.repository, commitSha: reference.commitSha, files: referenceFiles };
8156
- const referenceDigest = await digestCodeRepositorySnapshot(source2, { maximumFiles: 1e4, maximumBytes: 16 * 1024 * 1024 });
8157
+ const referenceDigest = await digestCodeRepositorySnapshot(source2, repositoryLimits);
8157
8158
  if (referenceDigest !== reference.treeDigest) throw invalid("reference source digest");
8158
8159
  references.push({ alias: reference.alias, ...source2, treeDigest: referenceDigest });
8159
8160
  }
8160
8161
  const source = { repository: snapshot.repository, commitSha: snapshot.commitSha, files };
8161
- const digest = await digestCodeRepositorySnapshot(source, { maximumFiles: 1e4, maximumBytes: 16 * 1024 * 1024 });
8162
+ const digest = await digestCodeRepositorySnapshot(source, repositoryLimits);
8162
8163
  if (digest !== snapshot.treeDigest) throw invalid("source digest");
8163
8164
  return { ...source, treeDigest: digest, ...references.length ? { references } : {} };
8164
8165
  }
@@ -8747,7 +8748,7 @@ async function prepareRuntimeLocalSource(input) {
8747
8748
  return { workspace, sourceDigest: descriptor2.snapshotDigest, trustedBaseDigest };
8748
8749
  }
8749
8750
  async function materializeCodeRuntimeSource(snapshot, tempRoot = (0, import_os3.tmpdir)()) {
8750
- if (!snapshot.files.length || snapshot.files.length > 1e4) throw new TypeError("Code source file count is invalid");
8751
+ if (!snapshot.files.length || snapshot.files.length > SOURCE_MAX_FILES) throw new TypeError("Code source file count is invalid");
8751
8752
  const root = await (0, import_promises8.mkdtemp)((0, import_path8.join)(tempRoot, "odla-code-source-"));
8752
8753
  const sourceDir = (0, import_path8.join)(root, "source");
8753
8754
  await (0, import_promises8.mkdir)(sourceDir);
@@ -8759,7 +8760,7 @@ async function materializeCodeRuntimeSource(snapshot, tempRoot = (0, import_os3.
8759
8760
  if (seen.has(file.path)) throw new TypeError("Code source repeats a path");
8760
8761
  seen.add(file.path);
8761
8762
  bytes += Buffer.byteLength(file.path) + Buffer.byteLength(file.content);
8762
- if (bytes > 16 * 1024 * 1024) throw new TypeError("Code source exceeds its byte bound");
8763
+ if (bytes > SOURCE_MAX_BYTES) throw new TypeError("Code source exceeds its byte bound");
8763
8764
  const target = (0, import_path8.resolve)(sourceDir, file.path);
8764
8765
  if (!target.startsWith(`${(0, import_path8.resolve)(sourceDir)}${import_path8.sep}`)) throw new TypeError("Code source path escapes its root");
8765
8766
  await (0, import_promises8.mkdir)((0, import_path8.dirname)(target), { recursive: true });
@@ -8767,14 +8768,14 @@ async function materializeCodeRuntimeSource(snapshot, tempRoot = (0, import_os3.
8767
8768
  }
8768
8769
  for (const reference of snapshot.references ?? []) {
8769
8770
  validateAlias(reference.alias);
8770
- if (!reference.files.length || reference.files.length > 1e4) throw new TypeError("Code reference file count is invalid");
8771
+ if (!reference.files.length || reference.files.length > SOURCE_MAX_FILES) throw new TypeError("Code reference file count is invalid");
8771
8772
  for (const file of reference.files) {
8772
8773
  validatePath(file.path);
8773
8774
  const path = `.odla-references/${reference.alias}/${file.path}`;
8774
8775
  if (seen.has(path)) throw new TypeError("Code reference repeats a path");
8775
8776
  seen.add(path);
8776
8777
  bytes += Buffer.byteLength(path) + Buffer.byteLength(file.content);
8777
- if (bytes > 80 * 1024 * 1024) throw new TypeError("Code source set exceeds its byte bound");
8778
+ if (bytes > SOURCE_SET_MAX_BYTES) throw new TypeError("Code source set exceeds its byte bound");
8778
8779
  const target = (0, import_path8.resolve)(sourceDir, path);
8779
8780
  if (!target.startsWith(`${(0, import_path8.resolve)(sourceDir)}${import_path8.sep}`)) throw new TypeError("Code reference path escapes its root");
8780
8781
  await (0, import_promises8.mkdir)((0, import_path8.dirname)(target), { recursive: true });
@@ -8800,7 +8801,7 @@ async function attachCodeRuntimeReferences(workspace, references) {
8800
8801
  validatePath(file.path);
8801
8802
  const path = `.odla-references/${reference.alias}/${file.path}`;
8802
8803
  bytes += Buffer.byteLength(path) + Buffer.byteLength(file.content);
8803
- if (bytes > 64 * 1024 * 1024) throw new TypeError("Code reference set exceeds its byte bound");
8804
+ if (bytes > SOURCE_SET_MAX_BYTES - SOURCE_MAX_BYTES) throw new TypeError("Code reference set exceeds its byte bound");
8804
8805
  for (const root of [workspace.baselineDir, workspace.workspaceDir]) {
8805
8806
  const target = (0, import_path8.resolve)(root, path);
8806
8807
  if (!target.startsWith(`${(0, import_path8.resolve)(root)}${import_path8.sep}`)) throw new TypeError("Code reference path escapes its root");
@@ -8850,7 +8851,10 @@ async function materializeCommandWorkspace(input) {
8850
8851
  trustedBaseDir: materialized.sourceDir,
8851
8852
  trustedBaseCommitSha: source.commitSha,
8852
8853
  checkpoint: codeCheckpointPayload(command.payload)
8853
- })).workspace : await stageWorkspace(materialized.sourceDir);
8854
+ })).workspace : await stageWorkspace(materialized.sourceDir, {
8855
+ maxFiles: SOURCE_MAX_FILES,
8856
+ maxBytes: SOURCE_SET_MAX_BYTES
8857
+ });
8854
8858
  return { workspace, sourceDigest: source.treeDigest, requestedLocal: null };
8855
8859
  } finally {
8856
8860
  await materialized.cleanup();
@@ -9910,9 +9914,9 @@ async function appendCodeRuntimeEvent(control, command, event, refs) {
9910
9914
  const bounded = event.type === "message" ? { ...event, body: event.body.trim().slice(0, 2e4) || `${event.actor} event` } : event;
9911
9915
  await control.appendSessionEvent(command.sessionId, eventId, bounded);
9912
9916
  }
9913
- var import_crypto, import_promises5, import_path5, import_child_process4, import_promises6, import_path6, import_child_process5, import_process2, import_crypto2, import_crypto3, import_fs2, import_promises7, import_path7, import_promises8, import_os3, import_path8, import_ai4, import_promises9, import_path9, import_promises10, import_promises11, import_path10, import_crypto4, CODE_RUNTIME_PROTOCOL_VERSION, CodeRuntimeReconciler, CodeRuntimeControlError, record5, invalid, RESERVED, SECRET, PATH, FORBIDDEN, ARTIFACT_PATH, PRIVATE_ARTIFACT_PART, SHA3, DIGEST3, ID3, RULE, DEFAULT_PREFIXES, DEFAULT_SUFFIXES, message, CodeRuntimeCheckpointManager, record22, SOURCE_LIMITS, RESERVED2, SECRET2, V1_SYSTEM_PROMPT, V2_SYSTEM_PROMPT, V3_SYSTEM_PROMPT, SYSTEM_PROMPT_FOR, DEFAULT_MAX_FILES, DEFAULT_MAX_RESULTS, DEFAULT_MAX_FILE_BYTES, DESTINATIONS, READ, LIST, SEARCH, GRAPH, PATCH, RECIPE, cache, shortId, GRAPH_TOOLS, MAX_MEMORY_BODY, POSITIVE, digestRuntimeValue, runtimeErrorMessage, CodePiRuntimeEngine;
9914
- var init_chunk_UVGZHNLW = __esm({
9915
- "../harness/dist/chunk-UVGZHNLW.js"() {
9917
+ var import_crypto, import_promises5, import_path5, import_child_process4, import_promises6, import_path6, import_child_process5, import_process2, import_crypto2, import_crypto3, import_fs2, import_promises7, import_path7, import_promises8, import_os3, import_path8, import_ai4, import_promises9, import_path9, import_promises10, import_promises11, import_path10, import_crypto4, CODE_RUNTIME_PROTOCOL_VERSION, CodeRuntimeReconciler, CodeRuntimeControlError, record5, invalid, RESERVED, SECRET, PATH, FORBIDDEN, ARTIFACT_PATH, PRIVATE_ARTIFACT_PART, SHA3, DIGEST3, ID3, RULE, DEFAULT_PREFIXES, DEFAULT_SUFFIXES, message, CodeRuntimeCheckpointManager, record22, SOURCE_LIMITS, RESERVED2, SECRET2, SOURCE_MAX_FILES, SOURCE_MAX_BYTES, SOURCE_SET_MAX_BYTES, V1_SYSTEM_PROMPT, V2_SYSTEM_PROMPT, V3_SYSTEM_PROMPT, SYSTEM_PROMPT_FOR, DEFAULT_MAX_FILES, DEFAULT_MAX_RESULTS, DEFAULT_MAX_FILE_BYTES, DESTINATIONS, READ, LIST, SEARCH, GRAPH, PATCH, RECIPE, cache, shortId, GRAPH_TOOLS, MAX_MEMORY_BODY, POSITIVE, digestRuntimeValue, runtimeErrorMessage, CodePiRuntimeEngine;
9918
+ var init_chunk_L2T3LPEF = __esm({
9919
+ "../harness/dist/chunk-L2T3LPEF.js"() {
9916
9920
  "use strict";
9917
9921
  init_cjs_shims();
9918
9922
  init_chunk_K76I2TCQ();
@@ -10052,6 +10056,9 @@ var init_chunk_UVGZHNLW = __esm({
10052
10056
  SOURCE_LIMITS = { maxFiles: 2e4, maxBytes: 512 * 1024 * 1024 };
10053
10057
  RESERVED2 = /* @__PURE__ */ new Set([".git", ".odla", ".wrangler", "node_modules", "dist", "coverage"]);
10054
10058
  SECRET2 = /^(?:\.env(?:\..+)?|\.dev\.vars|credentials(?:\..+)?\.json|dev-token(?:\..+)?\.json)$/i;
10059
+ SOURCE_MAX_FILES = 1e5;
10060
+ SOURCE_MAX_BYTES = 80 * 1024 * 1024;
10061
+ SOURCE_SET_MAX_BYTES = 480 * 1024 * 1024;
10055
10062
  V1_SYSTEM_PROMPT = `You are Pi, the coding agent inside an odla Code harness.
10056
10063
  Use only the odla_read, odla_apply_git_diff, and odla_run_recipe tools.
10057
10064
  For mutations, call odla_apply_git_diff with raw git diff text. It must start
@@ -10431,7 +10438,7 @@ var init_node = __esm({
10431
10438
  "../harness/dist/node.js"() {
10432
10439
  "use strict";
10433
10440
  init_cjs_shims();
10434
- init_chunk_UVGZHNLW();
10441
+ init_chunk_L2T3LPEF();
10435
10442
  init_chunk_K76I2TCQ();
10436
10443
  MEASURED_PREMIUM = Object.freeze({
10437
10444
  /** 3 racers vs pure depth at equal budget: 21,044 / 7,936. */