@tangle-network/agent-app 0.44.56 → 0.44.57

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.
@@ -100,7 +100,7 @@ import {
100
100
  flattenHistory,
101
101
  readSandboxBinaryBytes,
102
102
  statSandboxFileSize
103
- } from "../chunk-6W5Y4J2X.js";
103
+ } from "../chunk-2UDJH6QR.js";
104
104
  import "../chunk-LWSJK546.js";
105
105
  import "../chunk-CQZSAR77.js";
106
106
  import "../chunk-ICOHEZK6.js";
@@ -742,6 +742,7 @@ async function resolveSandboxClientCredentials(options = {}) {
742
742
  `Sandbox credentials are required for ${environment} (provide a provision callback${directHint}).`
743
743
  );
744
744
  }
745
+ var DEFAULT_SIDECAR_PROCESS_PATTERN = "opencode|claude|codex";
745
746
  var DEFAULT_SANDBOX_RESOURCES = {
746
747
  image: "universal",
747
748
  cpuCores: 2,
@@ -1215,10 +1216,20 @@ function assertEnvWithinLimits(env) {
1215
1216
  );
1216
1217
  }
1217
1218
  }
1219
+ function resolveSidecarProcessPattern(probe, harness) {
1220
+ const pattern = probe.sidecarProcessPattern?.(harness) ?? DEFAULT_SIDECAR_PROCESS_PATTERN;
1221
+ if (pattern.includes("\\|")) {
1222
+ throw new Error(
1223
+ 'Invalid livenessProbe.sidecarProcessPattern: pgrep -f uses extended regular expressions; use a bare "|" for alternation, not "\\|".'
1224
+ );
1225
+ }
1226
+ return pattern;
1227
+ }
1218
1228
  async function isBoxAlive(box, harness, probe) {
1219
1229
  if (!probe) return true;
1220
1230
  const execTimeout = probe.execTimeoutMs ?? 5e3;
1221
1231
  const psTimeout = probe.psTimeoutMs ?? 3e3;
1232
+ const pattern = resolveSidecarProcessPattern(probe, harness);
1222
1233
  const race = (p, ms, label) => Promise.race([
1223
1234
  p,
1224
1235
  new Promise((_, reject) => setTimeout(() => reject(new Error(label)), ms))
@@ -1226,7 +1237,6 @@ async function isBoxAlive(box, harness, probe) {
1226
1237
  try {
1227
1238
  const alive = await race(box.exec("echo alive"), execTimeout, "alive check timeout");
1228
1239
  if (!alive.stdout.includes("alive")) return false;
1229
- const pattern = probe.sidecarProcessPattern(harness);
1230
1240
  try {
1231
1241
  const ps = await race(
1232
1242
  box.exec(`pgrep -f ${shellSingleQuote(pattern)} || echo no-sidecar`),
@@ -1995,6 +2005,7 @@ export {
1995
2005
  PREWARM_CLAIM_TABLE_DDL,
1996
2006
  createD1PrewarmClaimStore,
1997
2007
  resolveSandboxClientCredentials,
2008
+ DEFAULT_SIDECAR_PROCESS_PATTERN,
1998
2009
  DEFAULT_SANDBOX_RESOURCES,
1999
2010
  getClient,
2000
2011
  resetClientCache,
@@ -2038,4 +2049,4 @@ export {
2038
2049
  isTerminalPromptEvent,
2039
2050
  detectInteractiveQuestion
2040
2051
  };
2041
- //# sourceMappingURL=chunk-6W5Y4J2X.js.map
2052
+ //# sourceMappingURL=chunk-2UDJH6QR.js.map