@scheduler-systems/gal-run 0.0.597 → 0.0.599

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.
Files changed (2) hide show
  1. package/dist/index.cjs +26 -19
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -3955,7 +3955,7 @@ var cliVersion, defaultApiUrl, BUILD_CONSTANTS, constants_default;
3955
3955
  var init_constants = __esm({
3956
3956
  "module_6"() {
3957
3957
  "use strict";
3958
- cliVersion = true ? "0.0.597" : "0.0.0-dev";
3958
+ cliVersion = true ? "0.0.599" : "0.0.0-dev";
3959
3959
  defaultApiUrl = true ? "https://api.gal.run" : "http://localhost:3000";
3960
3960
  BUILD_CONSTANTS = Object.freeze([cliVersion, defaultApiUrl]);
3961
3961
  constants_default = BUILD_CONSTANTS;
@@ -11868,7 +11868,7 @@ function detectEnvironment() {
11868
11868
  return "dev";
11869
11869
  }
11870
11870
  try {
11871
- const version2 = true ? "0.0.597" : void 0;
11871
+ const version2 = true ? "0.0.599" : void 0;
11872
11872
  if (version2 && version2.includes("-local")) {
11873
11873
  return "dev";
11874
11874
  }
@@ -14549,7 +14549,7 @@ function getId() {
14549
14549
  }
14550
14550
  function getCliVersion() {
14551
14551
  try {
14552
- return true ? "0.0.597" : "0.0.0-dev";
14552
+ return true ? "0.0.599" : "0.0.0-dev";
14553
14553
  } catch {
14554
14554
  return "0.0.0-dev";
14555
14555
  }
@@ -58299,10 +58299,19 @@ function writeClaudeConfig(directory, configData, syncedFiles, syncedItems, orgN
58299
58299
  }
58300
58300
  return true;
58301
58301
  }
58302
+ function writeManagedTextFile(filePath, relativePath, content) {
58303
+ if ((0, import_fs29.existsSync)(filePath) && (0, import_fs29.readFileSync)(filePath, "utf-8") === content) {
58304
+ return true;
58305
+ }
58306
+ if (!isSafeToWrite(filePath, relativePath)) {
58307
+ return false;
58308
+ }
58309
+ (0, import_fs29.writeFileSync)(filePath, content, "utf-8");
58310
+ return true;
58311
+ }
58302
58312
  if (configData.instructions?.content) {
58303
58313
  const claudeMdPath = (0, import_path27.join)(directory, "CLAUDE.md");
58304
- if (isSafeToWrite(claudeMdPath, "CLAUDE.md")) {
58305
- (0, import_fs29.writeFileSync)(claudeMdPath, configData.instructions.content, "utf-8");
58314
+ if (writeManagedTextFile(claudeMdPath, "CLAUDE.md", configData.instructions.content)) {
58306
58315
  syncedFiles.push("CLAUDE.md");
58307
58316
  syncedItems.push({
58308
58317
  path: "CLAUDE.md",
@@ -58326,8 +58335,7 @@ function writeClaudeConfig(directory, configData, syncedFiles, syncedItems, orgN
58326
58335
  (0, import_fs29.mkdirSync)(fileDir, { recursive: true });
58327
58336
  }
58328
58337
  const relativePath = `.claude/commands/${fileName}`;
58329
- if (isSafeToWrite(filePath, relativePath)) {
58330
- (0, import_fs29.writeFileSync)(filePath, cmd.content, "utf-8");
58338
+ if (writeManagedTextFile(filePath, relativePath, cmd.content)) {
58331
58339
  syncedFiles.push(relativePath);
58332
58340
  const { description, allowedTools } = parseCommandFrontmatter(cmd.content);
58333
58341
  syncedItems.push({
@@ -58349,8 +58357,7 @@ function writeClaudeConfig(directory, configData, syncedFiles, syncedItems, orgN
58349
58357
  for (const hook of configData.hooks) {
58350
58358
  const filePath = (0, import_path27.join)(hooksDir, hook.name);
58351
58359
  const relativePath = `.claude/hooks/${hook.name}`;
58352
- if (isSafeToWrite(filePath, relativePath)) {
58353
- (0, import_fs29.writeFileSync)(filePath, hook.content, "utf-8");
58360
+ if (writeManagedTextFile(filePath, relativePath, hook.content)) {
58354
58361
  syncedFiles.push(relativePath);
58355
58362
  syncedItems.push({
58356
58363
  path: relativePath,
@@ -58435,8 +58442,7 @@ function writeClaudeConfig(directory, configData, syncedFiles, syncedItems, orgN
58435
58442
  (0, import_fs29.mkdirSync)(fileDir, { recursive: true });
58436
58443
  }
58437
58444
  const relativePath = `.claude/agents/${fileName}`;
58438
- if (isSafeToWrite(filePath, relativePath)) {
58439
- (0, import_fs29.writeFileSync)(filePath, agent.content, "utf-8");
58445
+ if (writeManagedTextFile(filePath, relativePath, agent.content)) {
58440
58446
  syncedFiles.push(relativePath);
58441
58447
  const { description } = parseCommandFrontmatter(agent.content);
58442
58448
  syncedItems.push({
@@ -58461,8 +58467,7 @@ function writeClaudeConfig(directory, configData, syncedFiles, syncedItems, orgN
58461
58467
  }
58462
58468
  const skillPath = (0, import_path27.join)(skillDir, "SKILL.md");
58463
58469
  const relativePath = `.claude/skills/${skill.name}/SKILL.md`;
58464
- if (isSafeToWrite(skillPath, relativePath)) {
58465
- (0, import_fs29.writeFileSync)(skillPath, skill.content, "utf-8");
58470
+ if (writeManagedTextFile(skillPath, relativePath, skill.content)) {
58466
58471
  syncedFiles.push(relativePath);
58467
58472
  syncedItems.push({
58468
58473
  path: relativePath,
@@ -58483,8 +58488,7 @@ function writeClaudeConfig(directory, configData, syncedFiles, syncedItems, orgN
58483
58488
  const fileName = rule.name.endsWith(".md") ? rule.name : `${rule.name}.md`;
58484
58489
  const filePath = (0, import_path27.join)(rulesDir, fileName);
58485
58490
  const relativePath = `.claude/rules/${fileName}`;
58486
- if (isSafeToWrite(filePath, relativePath)) {
58487
- (0, import_fs29.writeFileSync)(filePath, rule.content, "utf-8");
58491
+ if (writeManagedTextFile(filePath, relativePath, rule.content)) {
58488
58492
  syncedFiles.push(relativePath);
58489
58493
  syncedItems.push({
58490
58494
  path: relativePath,
@@ -61878,11 +61882,14 @@ function buildCodeChildEnv(baseEnv, options = {}) {
61878
61882
  return childEnv;
61879
61883
  }
61880
61884
  function resolveCodeVariantBinaryCandidates(variant, galCodeMode) {
61881
- const localWrapper = import_node_path5.default.join(import_node_os4.default.homedir(), ".local", "bin", `gal-code-${variant}`);
61882
- const galWrapper = `gal-code-${variant}`;
61885
+ const localWrappers = variant === "opencode" ? [
61886
+ import_node_path5.default.join(import_node_os4.default.homedir(), ".local", "bin", "gal-code"),
61887
+ import_node_path5.default.join(import_node_os4.default.homedir(), ".local", "bin", "gal-code-opencode")
61888
+ ] : [import_node_path5.default.join(import_node_os4.default.homedir(), ".local", "bin", `gal-code-${variant}`)];
61889
+ const galWrappers = variant === "opencode" ? ["gal-code-opencode"] : [`gal-code-${variant}`];
61883
61890
  const officialBinary = OFFICIAL_VARIANT_BINARIES[variant];
61884
61891
  const localFirst = galCodeMode === "dev";
61885
- const candidates = localFirst ? [localWrapper, galWrapper, officialBinary] : [officialBinary, localWrapper, galWrapper];
61892
+ const candidates = localFirst ? [...localWrappers, ...galWrappers, officialBinary] : [officialBinary, ...localWrappers, ...galWrappers];
61886
61893
  return candidates.filter((binary, index) => candidates.indexOf(binary) === index);
61887
61894
  }
61888
61895
  function buildOpencodeEnv() {
@@ -82417,7 +82424,7 @@ var init_index = __esm({
82417
82424
  }
82418
82425
  });
82419
82426
 
82420
- var cliVersion10 = true ? "0.0.597" : "0.0.0-dev";
82427
+ var cliVersion10 = true ? "0.0.599" : "0.0.0-dev";
82421
82428
  var args = process.argv.slice(2);
82422
82429
  var requestedGlobalHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
82423
82430
  var requestedVersion = args.length === 1 && (args[0] === "--version" || args[0] === "-V");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scheduler-systems/gal-run",
3
- "version": "0.0.597",
3
+ "version": "0.0.599",
4
4
  "description": "GAL CLI - Command-line tool for managing AI agent configurations across your organization",
5
5
  "license": "Elastic-2.0",
6
6
  "private": false,