labgate 0.5.33 → 0.5.34

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.
@@ -29999,6 +29999,9 @@ var DEFAULT_CONFIG = {
29999
29999
  audit: {
30000
30000
  enabled: true,
30001
30001
  log_dir: "~/.labgate/logs"
30002
+ },
30003
+ headless: {
30004
+ claude_run_with_allowed_permissions: true
30002
30005
  }
30003
30006
  };
30004
30007
  var LABGATE_DIR = process.env.LABGATE_DIR ?? join(homedir(), ".labgate");
@@ -30034,6 +30037,7 @@ function validateConfig(config2) {
30034
30037
  const blockedPatterns = config2.filesystem?.blocked_patterns;
30035
30038
  const extraPaths = config2.filesystem?.extra_paths;
30036
30039
  const blacklist = config2.commands?.blacklist;
30040
+ const headless = config2.headless;
30037
30041
  if (!VALID_RUNTIMES.includes(config2.runtime)) {
30038
30042
  errors.push(`Invalid runtime: "${config2.runtime}". Must be one of: ${VALID_RUNTIMES.join(", ")}`);
30039
30043
  }
@@ -30058,6 +30062,13 @@ function validateConfig(config2) {
30058
30062
  if (!Array.isArray(blacklist)) {
30059
30063
  errors.push("commands.blacklist must be an array");
30060
30064
  }
30065
+ if (headless !== void 0) {
30066
+ if (!headless || typeof headless !== "object" || Array.isArray(headless)) {
30067
+ errors.push("headless must be an object");
30068
+ } else if (headless.claude_run_with_allowed_permissions !== void 0 && typeof headless.claude_run_with_allowed_permissions !== "boolean") {
30069
+ errors.push("headless.claude_run_with_allowed_permissions must be a boolean");
30070
+ }
30071
+ }
30061
30072
  const mounts = Array.isArray(extraPaths) ? extraPaths : [];
30062
30073
  for (const mount of mounts) {
30063
30074
  if (!mount || typeof mount !== "object") {
@@ -30156,6 +30167,9 @@ function loadConfig() {
30156
30167
  audit: {
30157
30168
  enabled: raw.audit?.enabled ?? DEFAULT_CONFIG.audit.enabled,
30158
30169
  log_dir: raw.audit?.log_dir ?? DEFAULT_CONFIG.audit.log_dir
30170
+ },
30171
+ headless: {
30172
+ claude_run_with_allowed_permissions: raw.headless?.claude_run_with_allowed_permissions ?? DEFAULT_CONFIG.headless?.claude_run_with_allowed_permissions ?? true
30159
30173
  }
30160
30174
  };
30161
30175
  const errors = validateConfig(config2);
@@ -7233,6 +7233,7 @@ __export(config_exports, {
7233
7233
  getUiSocketPath: () => getUiSocketPath,
7234
7234
  loadConfig: () => loadConfig,
7235
7235
  loadEffectiveConfig: () => loadEffectiveConfig,
7236
+ shouldClaudeHeadlessRunWithAllowedPermissions: () => shouldClaudeHeadlessRunWithAllowedPermissions,
7236
7237
  validateConfig: () => validateConfig
7237
7238
  });
7238
7239
  import { readFileSync as readFileSync3, existsSync as existsSync3, chmodSync, mkdirSync } from "fs";
@@ -7311,6 +7312,9 @@ function getExplorerLockDir(experimentId) {
7311
7312
  function getExplorerWorktreesDir(experimentId) {
7312
7313
  return join3(getExplorerWorktreesRootDir(), experimentId);
7313
7314
  }
7315
+ function shouldClaudeHeadlessRunWithAllowedPermissions(config2) {
7316
+ return config2.headless?.claude_run_with_allowed_permissions !== false;
7317
+ }
7314
7318
  function cloneConfig(config2) {
7315
7319
  return JSON.parse(JSON.stringify(config2));
7316
7320
  }
@@ -7321,6 +7325,7 @@ function validateConfig(config2) {
7321
7325
  const blockedPatterns = config2.filesystem?.blocked_patterns;
7322
7326
  const extraPaths = config2.filesystem?.extra_paths;
7323
7327
  const blacklist = config2.commands?.blacklist;
7328
+ const headless = config2.headless;
7324
7329
  if (!VALID_RUNTIMES2.includes(config2.runtime)) {
7325
7330
  errors.push(`Invalid runtime: "${config2.runtime}". Must be one of: ${VALID_RUNTIMES2.join(", ")}`);
7326
7331
  }
@@ -7345,6 +7350,13 @@ function validateConfig(config2) {
7345
7350
  if (!Array.isArray(blacklist)) {
7346
7351
  errors.push("commands.blacklist must be an array");
7347
7352
  }
7353
+ if (headless !== void 0) {
7354
+ if (!headless || typeof headless !== "object" || Array.isArray(headless)) {
7355
+ errors.push("headless must be an object");
7356
+ } else if (headless.claude_run_with_allowed_permissions !== void 0 && typeof headless.claude_run_with_allowed_permissions !== "boolean") {
7357
+ errors.push("headless.claude_run_with_allowed_permissions must be a boolean");
7358
+ }
7359
+ }
7348
7360
  const mounts = Array.isArray(extraPaths) ? extraPaths : [];
7349
7361
  for (const mount of mounts) {
7350
7362
  if (!mount || typeof mount !== "object") {
@@ -7443,6 +7455,9 @@ function loadConfig() {
7443
7455
  audit: {
7444
7456
  enabled: raw.audit?.enabled ?? DEFAULT_CONFIG.audit.enabled,
7445
7457
  log_dir: raw.audit?.log_dir ?? DEFAULT_CONFIG.audit.log_dir
7458
+ },
7459
+ headless: {
7460
+ claude_run_with_allowed_permissions: raw.headless?.claude_run_with_allowed_permissions ?? DEFAULT_CONFIG.headless?.claude_run_with_allowed_permissions ?? true
7446
7461
  }
7447
7462
  };
7448
7463
  const errors = validateConfig(config2);
@@ -7576,6 +7591,9 @@ var init_config = __esm({
7576
7591
  audit: {
7577
7592
  enabled: true,
7578
7593
  log_dir: "~/.labgate/logs"
7594
+ },
7595
+ headless: {
7596
+ claude_run_with_allowed_permissions: true
7579
7597
  }
7580
7598
  };
7581
7599
  LABGATE_DIR = process.env.LABGATE_DIR ?? join3(homedir3(), ".labgate");
@@ -38061,6 +38079,7 @@ function runClaudeHeadlessInWorktree(input) {
38061
38079
  "--output-format",
38062
38080
  "stream-json",
38063
38081
  "--include-partial-messages",
38082
+ ...shouldClaudeHeadlessRunWithAllowedPermissions(config2) ? ["--dangerously-skip-permissions"] : [],
38064
38083
  ...resumeSessionId ? ["--resume", resumeSessionId] : [],
38065
38084
  prompt
38066
38085
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labgate",
3
- "version": "0.5.33",
3
+ "version": "0.5.34",
4
4
  "description": "Secure HPC wrapper for AI coding agents (Claude-first): policy controls, Apptainer sandboxes, and SLURM workflows — https://labgate.dev",
5
5
  "homepage": "https://labgate.dev",
6
6
  "keywords": [