@scheduler-systems/gal-run 0.0.564 → 0.0.566

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/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.564" : "0.0.0-dev";
3958
+ cliVersion = true ? "0.0.566" : "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;
@@ -4583,7 +4583,7 @@ var init_failure_report = __esm({
4583
4583
  });
4584
4584
 
4585
4585
  function shouldDisableGlobalTimeout(argv = process.argv) {
4586
- return argv[2] === "code";
4586
+ return LONG_LIVED_COMMANDS.has(argv[2]);
4587
4587
  }
4588
4588
  function installGlobalTimeout({
4589
4589
  argv = process.argv,
@@ -4602,11 +4602,12 @@ function installGlobalTimeout({
4602
4602
  timeout.unref?.();
4603
4603
  return timeout;
4604
4604
  }
4605
- var GLOBAL_TIMEOUT_MS;
4605
+ var GLOBAL_TIMEOUT_MS, LONG_LIVED_COMMANDS;
4606
4606
  var init_global_timeout = __esm({
4607
4607
  "module_18"() {
4608
4608
  "use strict";
4609
4609
  GLOBAL_TIMEOUT_MS = 12e4;
4610
+ LONG_LIVED_COMMANDS = /* @__PURE__ */ new Set(["code", "session"]);
4610
4611
  }
4611
4612
  });
4612
4613
 
@@ -11857,7 +11858,7 @@ function detectEnvironment() {
11857
11858
  return "dev";
11858
11859
  }
11859
11860
  try {
11860
- const version2 = true ? "0.0.564" : void 0;
11861
+ const version2 = true ? "0.0.566" : void 0;
11861
11862
  if (version2 && version2.includes("-local")) {
11862
11863
  return "dev";
11863
11864
  }
@@ -14538,7 +14539,7 @@ function getId() {
14538
14539
  }
14539
14540
  function getCliVersion() {
14540
14541
  try {
14541
- return true ? "0.0.564" : "0.0.0-dev";
14542
+ return true ? "0.0.566" : "0.0.0-dev";
14542
14543
  } catch {
14543
14544
  return "0.0.0-dev";
14544
14545
  }
@@ -17940,11 +17941,11 @@ function getFeatureFlags() {
17940
17941
  let isInternalFromApi = false;
17941
17942
  let isPartnerFromApi = false;
17942
17943
  try {
17943
- const { readFileSync: readFileSync47, existsSync: existsSync56 } = require("fs");
17944
- const { join: join64 } = require("path");
17945
- const configPath = join64(resolveGalHomeDir(process.env), "config.json");
17946
- if (existsSync56(configPath)) {
17947
- const config2 = JSON.parse(readFileSync47(configPath, "utf-8"));
17944
+ const { readFileSync: readFileSync48, existsSync: existsSync57 } = require("fs");
17945
+ const { join: join65 } = require("path");
17946
+ const configPath = join65(resolveGalHomeDir(process.env), "config.json");
17947
+ if (existsSync57(configPath)) {
17948
+ const config2 = JSON.parse(readFileSync48(configPath, "utf-8"));
17948
17949
  const cacheAge = Date.now() - (config2.flagsCachedAt || config2.internalOrgsCheckedAt || 0);
17949
17950
  if (cacheAge < CACHE_MAX_AGE_MS) {
17950
17951
  const userOrgs = config2.orgMemberships || [];
@@ -27529,7 +27530,7 @@ var require_thread_stream = __commonJS({
27529
27530
  var { version: version2 } = require_package2();
27530
27531
  var { EventEmitter: EventEmitter3 } = require("events");
27531
27532
  var { Worker } = require("worker_threads");
27532
- var { join: join64 } = require("path");
27533
+ var { join: join65 } = require("path");
27533
27534
  var { pathToFileURL } = require("url");
27534
27535
  var { wait } = require_wait();
27535
27536
  var {
@@ -27565,7 +27566,7 @@ var require_thread_stream = __commonJS({
27565
27566
  function createWorker(stream, opts) {
27566
27567
  const { filename, workerData } = opts;
27567
27568
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
27568
- const toExecute = bundlerOverrides["thread-stream-worker"] || join64(__dirname, "lib", "worker.js");
27569
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join65(__dirname, "lib", "worker.js");
27569
27570
  const worker = new Worker(toExecute, {
27570
27571
  ...opts.workerOpts,
27571
27572
  trackUnmanagedFds: false,
@@ -27950,7 +27951,7 @@ var require_transport = __commonJS({
27950
27951
  "use strict";
27951
27952
  var { createRequire: createRequire3 } = require("module");
27952
27953
  var getCallers = require_caller();
27953
- var { join: join64, isAbsolute, sep } = require("node:path");
27954
+ var { join: join65, isAbsolute, sep } = require("node:path");
27954
27955
  var sleep2 = require_atomic_sleep();
27955
27956
  var onExit2 = require_on_exit_leak_free();
27956
27957
  var ThreadStream = require_thread_stream();
@@ -28013,7 +28014,7 @@ var require_transport = __commonJS({
28013
28014
  throw new Error("only one of target or targets can be specified");
28014
28015
  }
28015
28016
  if (targets) {
28016
- target = bundlerOverrides["pino-worker"] || join64(__dirname, "worker.js");
28017
+ target = bundlerOverrides["pino-worker"] || join65(__dirname, "worker.js");
28017
28018
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
28018
28019
  return {
28019
28020
  ...dest,
@@ -28031,7 +28032,7 @@ var require_transport = __commonJS({
28031
28032
  });
28032
28033
  });
28033
28034
  } else if (pipeline) {
28034
- target = bundlerOverrides["pino-worker"] || join64(__dirname, "worker.js");
28035
+ target = bundlerOverrides["pino-worker"] || join65(__dirname, "worker.js");
28035
28036
  options.pipelines = [pipeline.map((dest) => {
28036
28037
  return {
28037
28038
  ...dest,
@@ -28053,7 +28054,7 @@ var require_transport = __commonJS({
28053
28054
  return origin;
28054
28055
  }
28055
28056
  if (origin === "pino/file") {
28056
- return join64(__dirname, "..", "file.js");
28057
+ return join65(__dirname, "..", "file.js");
28057
28058
  }
28058
28059
  let fixTarget2;
28059
28060
  for (const filePath of callers) {
@@ -29036,7 +29037,7 @@ var require_safe_stable_stringify = __commonJS({
29036
29037
  return circularValue;
29037
29038
  }
29038
29039
  let res = "";
29039
- let join64 = ",";
29040
+ let join65 = ",";
29040
29041
  const originalIndentation = indentation;
29041
29042
  if (Array.isArray(value)) {
29042
29043
  if (value.length === 0) {
@@ -29050,7 +29051,7 @@ var require_safe_stable_stringify = __commonJS({
29050
29051
  indentation += spacer;
29051
29052
  res += `
29052
29053
  ${indentation}`;
29053
- join64 = `,
29054
+ join65 = `,
29054
29055
  ${indentation}`;
29055
29056
  }
29056
29057
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -29058,13 +29059,13 @@ ${indentation}`;
29058
29059
  for (; i < maximumValuesToStringify - 1; i++) {
29059
29060
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
29060
29061
  res += tmp2 !== void 0 ? tmp2 : "null";
29061
- res += join64;
29062
+ res += join65;
29062
29063
  }
29063
29064
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
29064
29065
  res += tmp !== void 0 ? tmp : "null";
29065
29066
  if (value.length - 1 > maximumBreadth) {
29066
29067
  const removedKeys = value.length - maximumBreadth - 1;
29067
- res += `${join64}"... ${getItemCount(removedKeys)} not stringified"`;
29068
+ res += `${join65}"... ${getItemCount(removedKeys)} not stringified"`;
29068
29069
  }
29069
29070
  if (spacer !== "") {
29070
29071
  res += `
@@ -29085,7 +29086,7 @@ ${originalIndentation}`;
29085
29086
  let separator = "";
29086
29087
  if (spacer !== "") {
29087
29088
  indentation += spacer;
29088
- join64 = `,
29089
+ join65 = `,
29089
29090
  ${indentation}`;
29090
29091
  whitespace = " ";
29091
29092
  }
@@ -29099,13 +29100,13 @@ ${indentation}`;
29099
29100
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
29100
29101
  if (tmp !== void 0) {
29101
29102
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
29102
- separator = join64;
29103
+ separator = join65;
29103
29104
  }
29104
29105
  }
29105
29106
  if (keyLength > maximumBreadth) {
29106
29107
  const removedKeys = keyLength - maximumBreadth;
29107
29108
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
29108
- separator = join64;
29109
+ separator = join65;
29109
29110
  }
29110
29111
  if (spacer !== "" && separator.length > 1) {
29111
29112
  res = `
@@ -29146,7 +29147,7 @@ ${originalIndentation}`;
29146
29147
  }
29147
29148
  const originalIndentation = indentation;
29148
29149
  let res = "";
29149
- let join64 = ",";
29150
+ let join65 = ",";
29150
29151
  if (Array.isArray(value)) {
29151
29152
  if (value.length === 0) {
29152
29153
  return "[]";
@@ -29159,7 +29160,7 @@ ${originalIndentation}`;
29159
29160
  indentation += spacer;
29160
29161
  res += `
29161
29162
  ${indentation}`;
29162
- join64 = `,
29163
+ join65 = `,
29163
29164
  ${indentation}`;
29164
29165
  }
29165
29166
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -29167,13 +29168,13 @@ ${indentation}`;
29167
29168
  for (; i < maximumValuesToStringify - 1; i++) {
29168
29169
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
29169
29170
  res += tmp2 !== void 0 ? tmp2 : "null";
29170
- res += join64;
29171
+ res += join65;
29171
29172
  }
29172
29173
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
29173
29174
  res += tmp !== void 0 ? tmp : "null";
29174
29175
  if (value.length - 1 > maximumBreadth) {
29175
29176
  const removedKeys = value.length - maximumBreadth - 1;
29176
- res += `${join64}"... ${getItemCount(removedKeys)} not stringified"`;
29177
+ res += `${join65}"... ${getItemCount(removedKeys)} not stringified"`;
29177
29178
  }
29178
29179
  if (spacer !== "") {
29179
29180
  res += `
@@ -29186,7 +29187,7 @@ ${originalIndentation}`;
29186
29187
  let whitespace = "";
29187
29188
  if (spacer !== "") {
29188
29189
  indentation += spacer;
29189
- join64 = `,
29190
+ join65 = `,
29190
29191
  ${indentation}`;
29191
29192
  whitespace = " ";
29192
29193
  }
@@ -29195,7 +29196,7 @@ ${indentation}`;
29195
29196
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
29196
29197
  if (tmp !== void 0) {
29197
29198
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
29198
- separator = join64;
29199
+ separator = join65;
29199
29200
  }
29200
29201
  }
29201
29202
  if (spacer !== "" && separator.length > 1) {
@@ -29253,20 +29254,20 @@ ${originalIndentation}`;
29253
29254
  indentation += spacer;
29254
29255
  let res2 = `
29255
29256
  ${indentation}`;
29256
- const join65 = `,
29257
+ const join66 = `,
29257
29258
  ${indentation}`;
29258
29259
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
29259
29260
  let i = 0;
29260
29261
  for (; i < maximumValuesToStringify - 1; i++) {
29261
29262
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
29262
29263
  res2 += tmp2 !== void 0 ? tmp2 : "null";
29263
- res2 += join65;
29264
+ res2 += join66;
29264
29265
  }
29265
29266
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
29266
29267
  res2 += tmp !== void 0 ? tmp : "null";
29267
29268
  if (value.length - 1 > maximumBreadth) {
29268
29269
  const removedKeys = value.length - maximumBreadth - 1;
29269
- res2 += `${join65}"... ${getItemCount(removedKeys)} not stringified"`;
29270
+ res2 += `${join66}"... ${getItemCount(removedKeys)} not stringified"`;
29270
29271
  }
29271
29272
  res2 += `
29272
29273
  ${originalIndentation}`;
@@ -29282,16 +29283,16 @@ ${originalIndentation}`;
29282
29283
  return '"[Object]"';
29283
29284
  }
29284
29285
  indentation += spacer;
29285
- const join64 = `,
29286
+ const join65 = `,
29286
29287
  ${indentation}`;
29287
29288
  let res = "";
29288
29289
  let separator = "";
29289
29290
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
29290
29291
  if (isTypedArrayWithEntries(value)) {
29291
- res += stringifyTypedArray(value, join64, maximumBreadth);
29292
+ res += stringifyTypedArray(value, join65, maximumBreadth);
29292
29293
  keys = keys.slice(value.length);
29293
29294
  maximumPropertiesToStringify -= value.length;
29294
- separator = join64;
29295
+ separator = join65;
29295
29296
  }
29296
29297
  if (deterministic) {
29297
29298
  keys = sort(keys, comparator);
@@ -29302,13 +29303,13 @@ ${indentation}`;
29302
29303
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
29303
29304
  if (tmp !== void 0) {
29304
29305
  res += `${separator}${strEscape(key2)}: ${tmp}`;
29305
- separator = join64;
29306
+ separator = join65;
29306
29307
  }
29307
29308
  }
29308
29309
  if (keyLength > maximumBreadth) {
29309
29310
  const removedKeys = keyLength - maximumBreadth;
29310
29311
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
29311
- separator = join64;
29312
+ separator = join65;
29312
29313
  }
29313
29314
  if (separator !== "") {
29314
29315
  res = `
@@ -50478,10 +50479,10 @@ function resolveOrg(options, config2) {
50478
50479
  function printApprovedConfig(config2, org) {
50479
50480
  console.log();
50480
50481
  console.log(source_default.bold(`Approved config for "${org}" (${config2.platform})`));
50481
- console.log(source_default.dim(` Version: ${config2.version || "unknown"}`));
50482
- console.log(source_default.dim(` Approved at: ${config2.approvedAt || "unknown"}`));
50483
- console.log(source_default.dim(` Approved by: ${config2.approvedBy || "unknown"}`));
50484
- console.log(source_default.dim(` Hash: ${config2.hash || "unknown"}`));
50482
+ console.log(source_default.dim(` Version: ${config2.version || "\u2014"}`));
50483
+ console.log(source_default.dim(` Approved at: ${config2.approvedAt || "\u2014"}`));
50484
+ console.log(source_default.dim(` Approved by: ${config2.approvedBy || "\u2014"}`));
50485
+ console.log(source_default.dim(` Hash: ${config2.hash || "\u2014"}`));
50485
50486
  if (config2.policyName) {
50486
50487
  console.log(source_default.dim(` Policy: ${config2.policyName}`));
50487
50488
  }
@@ -50495,8 +50496,8 @@ function printApprovedConfig(config2, org) {
50495
50496
  console.log(` Agents: ${subagentCount}`);
50496
50497
  console.log(` Skills: ${skillCount}`);
50497
50498
  console.log(` Rules: ${ruleCount}`);
50498
- console.log(` Instructions: ${config2.instructions ? "yes" : "no"}`);
50499
- console.log(` Settings: ${config2.settings ? "yes" : "no"}`);
50499
+ console.log(` Instructions: ${config2.instructions ? "\u2713" : "\u2014"}`);
50500
+ console.log(` Settings: ${config2.settings ? "\u2713" : "\u2014"}`);
50500
50501
  if (commandCount > 0 && config2.commands) {
50501
50502
  console.log();
50502
50503
  console.log(source_default.bold(" Commands:"));
@@ -50572,11 +50573,11 @@ function createApprovedConfigCommand() {
50572
50573
  const spinner = options.json ? null : ora(`Fetching approved config for "${org}"...`).start();
50573
50574
  try {
50574
50575
  let findMdFiles2 = function(dir) {
50575
- if (!existsSync56(dir)) return [];
50576
+ if (!existsSync57(dir)) return [];
50576
50577
  const entries = readdirSync20(dir, { withFileTypes: true });
50577
50578
  const files = [];
50578
50579
  for (const entry of entries) {
50579
- const fullPath = join64(dir, entry.name);
50580
+ const fullPath = join65(dir, entry.name);
50580
50581
  if (entry.isDirectory()) files.push(...findMdFiles2(fullPath));
50581
50582
  else if (entry.name.endsWith(".md")) files.push(fullPath);
50582
50583
  }
@@ -50594,11 +50595,11 @@ function createApprovedConfigCommand() {
50594
50595
  }
50595
50596
  return;
50596
50597
  }
50597
- const { existsSync: existsSync56, readdirSync: readdirSync20, readFileSync: readFileSync47 } = await import("fs");
50598
- const { join: join64, relative: relative10, basename: basename11 } = await import("path");
50598
+ const { existsSync: existsSync57, readdirSync: readdirSync20, readFileSync: readFileSync48 } = await import("fs");
50599
+ const { join: join65, relative: relative10, basename: basename11 } = await import("path");
50599
50600
  const baseDir = options.dir || process.cwd();
50600
- const commandsDir = join64(baseDir, ".claude", "commands");
50601
- const agentsDir = join64(baseDir, ".claude", "agents");
50601
+ const commandsDir = join65(baseDir, ".claude", "commands");
50602
+ const agentsDir = join65(baseDir, ".claude", "agents");
50602
50603
  const localCommandNames = findMdFiles2(commandsDir).map(
50603
50604
  (f) => relative10(commandsDir, f).replace(/\.md$/, "").replace(/\//g, ":")
50604
50605
  );
@@ -53444,13 +53445,22 @@ function isPlaywrightMcpEntry(entry) {
53444
53445
  function injectBrowserGalServer(directory, projectPath2) {
53445
53446
  const mcpPath = (0, import_path22.join)(directory, ".mcp.json");
53446
53447
  const config2 = readMcpJsonFile(mcpPath);
53448
+ const existingServers = { ...config2.mcpServers ?? {} };
53449
+ delete existingServers["browser-work"];
53450
+ delete existingServers["browser-work-slack"];
53451
+ if (!existingServers["browser-slack"]) {
53452
+ existingServers["browser-slack"] = {
53453
+ command: "gal",
53454
+ args: ["browser", "browser-server", "--project-path", projectPath2, "--profile", "slack"]
53455
+ };
53456
+ }
53447
53457
  const servers = {
53448
- ...config2.mcpServers ?? {},
53458
+ ...existingServers,
53449
53459
  "browser-gal": {
53450
- // gal browser-server is a hidden subcommand of the gal binary itself,
53460
+ // gal browser-server is a hidden subcommand under `gal browser`,
53451
53461
  // so no separate gal-browser-server binary needs to be distributed.
53452
53462
  command: "gal",
53453
- args: ["browser-server", "--project-path", projectPath2]
53463
+ args: ["browser", "browser-server", "--project-path", projectPath2]
53454
53464
  }
53455
53465
  };
53456
53466
  const updated = { ...config2, mcpServers: servers };
@@ -60326,7 +60336,7 @@ var init_gal_code_session_collection = __esm({
60326
60336
  "use strict";
60327
60337
  import_fs32 = require("fs");
60328
60338
  import_path31 = require("path");
60329
- SESSION_DIR = (0, import_path31.join)(".claw", "sessions");
60339
+ SESSION_DIR = (0, import_path31.join)(".gal", "sessions");
60330
60340
  SETTINGS_TIMEOUT_MS = 5e3;
60331
60341
  UPLOAD_TIMEOUT_MS = 1e4;
60332
60342
  }
@@ -60572,7 +60582,7 @@ async function resolveGalCodeLaunchContext() {
60572
60582
  GAL_CODE_GAL_SESSION_TOKEN: authToken,
60573
60583
  RUST_BACKTRACE: process.env.RUST_BACKTRACE || "1",
60574
60584
  RUST_LIB_BACKTRACE: process.env.RUST_LIB_BACKTRACE || "1",
60575
- CLAW_CONFIG_HOME: getGalCodeAuthHome(),
60585
+ GAL_CODE_CONFIG_HOME: getGalCodeAuthHome(),
60576
60586
  GAL_CODE_CLAUDE_REFRESH_TOKEN: "",
60577
60587
  GAL_CODE_CLAUDE_AUTH_SOURCE: "",
60578
60588
  GAL_CODE_CLAUDE_AUTH_TYPE: "",
@@ -60589,7 +60599,9 @@ function getRemovedGalCodeAuthCommandError(command) {
60589
60599
  }
60590
60600
  function createCodeCommand() {
60591
60601
  return new Command("code").description("Launch the internal GAL Code CLI with your GAL session").helpOption(false).allowUnknownOption(true).allowExcessArguments(true).action(async () => {
60592
- const forwardedArgs = getForwardedArgs();
60602
+ const rawForwardedArgs = getForwardedArgs();
60603
+ const noTelemetryFlag = rawForwardedArgs.includes("--no-telemetry");
60604
+ const forwardedArgs = rawForwardedArgs.filter((arg) => arg !== "--no-telemetry");
60593
60605
  if (isGalCodeAuthCommand(forwardedArgs)) {
60594
60606
  console.error(source_default.red(getRemovedGalCodeAuthCommandError(forwardedArgs[0])));
60595
60607
  process.exit(1);
@@ -60643,9 +60655,13 @@ function createCodeCommand() {
60643
60655
  }
60644
60656
  const config2 = ConfigManager.load();
60645
60657
  let collectionEnabled = false;
60646
- try {
60647
- collectionEnabled = await resolveGalCodeSessionCollectionEnabled(config2);
60648
- } catch {
60658
+ if (noTelemetryFlag) {
60659
+ collectionEnabled = false;
60660
+ } else {
60661
+ try {
60662
+ collectionEnabled = await resolveGalCodeSessionCollectionEnabled(config2);
60663
+ } catch {
60664
+ }
60649
60665
  }
60650
60666
  const startedAt = /* @__PURE__ */ new Date();
60651
60667
  let exitCode = 0;
@@ -66457,13 +66473,13 @@ function getGitEmail() {
66457
66473
  }
66458
66474
  async function getLocalEnforcementStatus() {
66459
66475
  const { stat: stat6, readFile: readFile7 } = await import("node:fs/promises");
66460
- const { join: join64 } = await import("node:path");
66476
+ const { join: join65 } = await import("node:path");
66461
66477
  const platforms = [];
66462
66478
  let version2 = "0.0.0";
66463
66479
  let policyVersion = "0.0.0";
66464
66480
  const platformDirs = [".claude", ".cursor", ".gemini", ".codex", ".windsurf"];
66465
66481
  for (const dir of platformDirs) {
66466
- const hookPath = join64(process.cwd(), dir, "hooks", "gal-safety-hook.py");
66482
+ const hookPath = join65(process.cwd(), dir, "hooks", "gal-safety-hook.py");
66467
66483
  try {
66468
66484
  await stat6(hookPath);
66469
66485
  platforms.push(dir.replace(".", ""));
@@ -66476,7 +66492,7 @@ async function getLocalEnforcementStatus() {
66476
66492
  }
66477
66493
  }
66478
66494
  try {
66479
- const pkgPath = join64(import_meta2.url.replace("file://", ""), "..", "..", "..", "package.json");
66495
+ const pkgPath = join65(import_meta2.url.replace("file://", ""), "..", "..", "..", "package.json");
66480
66496
  const pkg = JSON.parse(await readFile7(pkgPath, "utf-8"));
66481
66497
  version2 = pkg.version || "0.1.0";
66482
66498
  } catch {
@@ -67783,7 +67799,7 @@ if __name__ == '__main__':
67783
67799
  `;
67784
67800
  }
67785
67801
  function createJoinCommand() {
67786
- const join64 = new Command("join").description("Join an organization using an invite code (GAL-100)").option("-c, --code <code>", "Invite code (e.g., GAL-XXXX-XXXX)").option("-e, --email <email>", "Developer email (defaults to git config)").option("--skip-hooks", "Skip enforcement hook installation").option("--dry-run", "Validate invite without joining").action(async (options) => {
67802
+ const join65 = new Command("join").description("Join an organization using an invite code (GAL-100)").option("-c, --code <code>", "Invite code (e.g., GAL-XXXX-XXXX)").option("-e, --email <email>", "Developer email (defaults to git config)").option("--skip-hooks", "Skip enforcement hook installation").option("--dry-run", "Validate invite without joining").action(async (options) => {
67787
67803
  const spinner = ora();
67788
67804
  if (!options.code) {
67789
67805
  console.log(source_default.bold("\nGAL Developer Onboarding\n"));
@@ -67899,7 +67915,7 @@ Error: ${useResult.error || "Unknown error"}`));
67899
67915
  process.exit(1);
67900
67916
  }
67901
67917
  });
67902
- return join64;
67918
+ return join65;
67903
67919
  }
67904
67920
  var import_node_os5, import_node_child_process2, import_node_crypto3, import_promises7, import_node_path5, defaultApiUrl10;
67905
67921
  var init_join = __esm({
@@ -75390,9 +75406,10 @@ var init_session_overlay = __esm({
75390
75406
 
75391
75407
  function resolveOrgName(env2) {
75392
75408
  try {
75393
- const configPath = resolveGalHomeDir(env2);
75394
- const cm = new ConfigManager(configPath);
75395
- const config2 = cm.getAll();
75409
+ const configPath = (0, import_path48.join)(resolveGalHomeDir(env2), "config.json");
75410
+ if (!(0, import_fs49.existsSync)(configPath)) return "unknown";
75411
+ const config2 = JSON.parse((0, import_fs49.readFileSync)(configPath, "utf-8"));
75412
+ if (config2.defaultOrg) return config2.defaultOrg;
75396
75413
  const orgs = config2.orgMemberships ?? [];
75397
75414
  return orgs[0] ?? "unknown";
75398
75415
  } catch {
@@ -75438,11 +75455,10 @@ async function runSession(cli, args2) {
75438
75455
  let pty;
75439
75456
  try {
75440
75457
  pty = await import("node-pty");
75441
- } catch (err) {
75442
- const msg = err instanceof Error ? err.message : String(err);
75443
- console.error(source_default.red(`Failed to load node-pty: ${msg}`));
75444
- console.error(source_default.dim('The "gal session" command requires node-pty native binaries.'));
75445
- console.error(source_default.dim("Run: npm rebuild node-pty"));
75458
+ } catch {
75459
+ console.error(source_default.red(
75460
+ "node-pty is required for gal session but is not installed.\nInstall it with: npm install -g node-pty\nOr reinstall GAL CLI: npm install -g @scheduler-systems/gal-run"
75461
+ ));
75446
75462
  process.exit(1);
75447
75463
  }
75448
75464
  let ptyProcess;
@@ -75535,13 +75551,14 @@ async function runSession(cli, args2) {
75535
75551
  removeScrollRegion(write, rows);
75536
75552
  process.exit(exitCode);
75537
75553
  }
75538
- var CTRL_G;
75554
+ var import_fs49, import_path48, CTRL_G;
75539
75555
  var init_session2 = __esm({
75540
75556
  "module_428"() {
75541
75557
  "use strict";
75542
75558
  init_esm();
75543
75559
  init_source();
75544
- init_config_manager();
75560
+ import_fs49 = require("fs");
75561
+ import_path48 = require("path");
75545
75562
  init_gal_home();
75546
75563
  init_session_status_bar();
75547
75564
  init_session_overlay();
@@ -75550,10 +75567,10 @@ var init_session2 = __esm({
75550
75567
  });
75551
75568
 
75552
75569
  function readTermsAcceptance() {
75553
- const configFile = (0, import_path48.join)((0, import_os29.homedir)(), ".gal", "config.json");
75570
+ const configFile = (0, import_path49.join)((0, import_os29.homedir)(), ".gal", "config.json");
75554
75571
  try {
75555
- if ((0, import_fs49.existsSync)(configFile)) {
75556
- const raw = JSON.parse((0, import_fs49.readFileSync)(configFile, "utf-8"));
75572
+ if ((0, import_fs50.existsSync)(configFile)) {
75573
+ const raw = JSON.parse((0, import_fs50.readFileSync)(configFile, "utf-8"));
75557
75574
  if (typeof raw.termsAcceptedAt === "string" && raw.termsAcceptedAt.length > 0) {
75558
75575
  return { accepted: true, acceptedAt: raw.termsAcceptedAt };
75559
75576
  }
@@ -75756,7 +75773,7 @@ function displayStatusJson(result, health) {
75756
75773
  }
75757
75774
  function isRateLimited(projectId) {
75758
75775
  try {
75759
- const raw = (0, import_fs49.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75776
+ const raw = (0, import_fs50.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75760
75777
  const cache = JSON.parse(raw);
75761
75778
  const lastReport = cache[projectId];
75762
75779
  if (lastReport && Date.now() - lastReport < RATE_LIMIT_MS) {
@@ -75770,13 +75787,13 @@ function recordReport(projectId) {
75770
75787
  try {
75771
75788
  let cache = {};
75772
75789
  try {
75773
- const raw = (0, import_fs49.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75790
+ const raw = (0, import_fs50.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75774
75791
  cache = JSON.parse(raw);
75775
75792
  } catch {
75776
75793
  }
75777
75794
  cache[projectId] = Date.now();
75778
- (0, import_fs49.mkdirSync)((0, import_path48.join)((0, import_os29.homedir)(), ".gal"), { recursive: true });
75779
- (0, import_fs49.writeFileSync)(DRIFT_REPORT_CACHE_PATH, JSON.stringify(cache));
75795
+ (0, import_fs50.mkdirSync)((0, import_path49.join)((0, import_os29.homedir)(), ".gal"), { recursive: true });
75796
+ (0, import_fs50.writeFileSync)(DRIFT_REPORT_CACHE_PATH, JSON.stringify(cache));
75780
75797
  } catch {
75781
75798
  }
75782
75799
  }
@@ -75922,16 +75939,16 @@ function createStatusCommand3() {
75922
75939
  });
75923
75940
  return command;
75924
75941
  }
75925
- var import_path48, import_os29, import_fs49, cliVersion7, defaultApiUrl18, PLATFORM_LABELS2, RATE_LIMIT_MS, DRIFT_REPORT_CACHE_PATH;
75942
+ var import_path49, import_os29, import_fs50, cliVersion7, defaultApiUrl18, PLATFORM_LABELS2, RATE_LIMIT_MS, DRIFT_REPORT_CACHE_PATH;
75926
75943
  var init_status = __esm({
75927
75944
  "module_429"() {
75928
75945
  "use strict";
75929
75946
  init_esm();
75930
75947
  init_source();
75931
75948
  init_ora();
75932
- import_path48 = require("path");
75949
+ import_path49 = require("path");
75933
75950
  import_os29 = require("os");
75934
- import_fs49 = require("fs");
75951
+ import_fs50 = require("fs");
75935
75952
  init_gal_config_service();
75936
75953
  init_config_manager();
75937
75954
  init_CoreServiceProvider();
@@ -75948,7 +75965,7 @@ var init_status = __esm({
75948
75965
  ])
75949
75966
  );
75950
75967
  RATE_LIMIT_MS = 5 * 60 * 1e3;
75951
- DRIFT_REPORT_CACHE_PATH = (0, import_path48.join)((0, import_os29.homedir)(), ".gal", "drift-report-cache.json");
75968
+ DRIFT_REPORT_CACHE_PATH = (0, import_path49.join)((0, import_os29.homedir)(), ".gal", "drift-report-cache.json");
75952
75969
  }
75953
75970
  });
75954
75971
 
@@ -77270,13 +77287,13 @@ function getGitHookManager() {
77270
77287
  }
77271
77288
  return defaultManager;
77272
77289
  }
77273
- var import_child_process17, import_fs50, import_path49, DEFAULT_GIT_HOOK_CONFIG, GitHookManager, defaultManager;
77290
+ var import_child_process17, import_fs51, import_path50, DEFAULT_GIT_HOOK_CONFIG, GitHookManager, defaultManager;
77274
77291
  var init_git_hooks = __esm({
77275
77292
  "module_435"() {
77276
77293
  "use strict";
77277
77294
  import_child_process17 = require("child_process");
77278
- import_fs50 = require("fs");
77279
- import_path49 = require("path");
77295
+ import_fs51 = require("fs");
77296
+ import_path50 = require("path");
77280
77297
  init_source();
77281
77298
  init_triggers();
77282
77299
  DEFAULT_GIT_HOOK_CONFIG = {
@@ -77319,12 +77336,12 @@ var init_git_hooks = __esm({
77319
77336
  if (this.gitDir) return this.gitDir;
77320
77337
  let currentPath = startPath;
77321
77338
  while (currentPath !== "/") {
77322
- const gitPath = (0, import_path49.join)(currentPath, ".git");
77323
- if ((0, import_fs50.existsSync)(gitPath)) {
77339
+ const gitPath = (0, import_path50.join)(currentPath, ".git");
77340
+ if ((0, import_fs51.existsSync)(gitPath)) {
77324
77341
  this.gitDir = gitPath;
77325
77342
  return gitPath;
77326
77343
  }
77327
- currentPath = (0, import_path49.dirname)(currentPath);
77344
+ currentPath = (0, import_path50.dirname)(currentPath);
77328
77345
  }
77329
77346
  return null;
77330
77347
  }
@@ -77346,29 +77363,29 @@ var init_git_hooks = __esm({
77346
77363
  ]
77347
77364
  };
77348
77365
  }
77349
- const hooksDir = (0, import_path49.join)(gitDir, "hooks");
77350
- if (!(0, import_fs50.existsSync)(hooksDir)) {
77351
- (0, import_fs50.mkdirSync)(hooksDir, { recursive: true });
77366
+ const hooksDir = (0, import_path50.join)(gitDir, "hooks");
77367
+ if (!(0, import_fs51.existsSync)(hooksDir)) {
77368
+ (0, import_fs51.mkdirSync)(hooksDir, { recursive: true });
77352
77369
  }
77353
77370
  const installed = [];
77354
77371
  const skipped = [];
77355
77372
  const warnings = [];
77356
77373
  for (const hookType of this.config.hooks) {
77357
- const hookPath = (0, import_path49.join)(hooksDir, hookType);
77374
+ const hookPath = (0, import_path50.join)(hooksDir, hookType);
77358
77375
  const hookScript = this.generateHookScript(hookType);
77359
- if ((0, import_fs50.existsSync)(hookPath)) {
77360
- const existing = (0, import_fs50.readFileSync)(hookPath, "utf-8");
77376
+ if ((0, import_fs51.existsSync)(hookPath)) {
77377
+ const existing = (0, import_fs51.readFileSync)(hookPath, "utf-8");
77361
77378
  if (existing.includes("GAL_HOOK_MARKER")) {
77362
- (0, import_fs50.writeFileSync)(hookPath, hookScript);
77363
- (0, import_fs50.chmodSync)(hookPath, "755");
77379
+ (0, import_fs51.writeFileSync)(hookPath, hookScript);
77380
+ (0, import_fs51.chmodSync)(hookPath, "755");
77364
77381
  installed.push(hookType);
77365
77382
  } else {
77366
77383
  console.log(source_default.yellow(`Skipping ${hookType}: existing hook found`));
77367
77384
  skipped.push(hookType);
77368
77385
  }
77369
77386
  } else {
77370
- (0, import_fs50.writeFileSync)(hookPath, hookScript);
77371
- (0, import_fs50.chmodSync)(hookPath, "755");
77387
+ (0, import_fs51.writeFileSync)(hookPath, hookScript);
77388
+ (0, import_fs51.chmodSync)(hookPath, "755");
77372
77389
  installed.push(hookType);
77373
77390
  }
77374
77391
  }
@@ -77385,12 +77402,12 @@ var init_git_hooks = __esm({
77385
77402
  if (!gitDir) {
77386
77403
  return [];
77387
77404
  }
77388
- const hooksDir = (0, import_path49.join)(gitDir, "hooks");
77405
+ const hooksDir = (0, import_path50.join)(gitDir, "hooks");
77389
77406
  const removed = [];
77390
77407
  for (const hookType of this.config.hooks) {
77391
- const hookPath = (0, import_path49.join)(hooksDir, hookType);
77392
- if ((0, import_fs50.existsSync)(hookPath)) {
77393
- const content = (0, import_fs50.readFileSync)(hookPath, "utf-8");
77408
+ const hookPath = (0, import_path50.join)(hooksDir, hookType);
77409
+ if ((0, import_fs51.existsSync)(hookPath)) {
77410
+ const content = (0, import_fs51.readFileSync)(hookPath, "utf-8");
77394
77411
  if (content.includes("GAL_HOOK_MARKER")) {
77395
77412
  const { unlinkSync: unlinkSync9 } = require("fs");
77396
77413
  unlinkSync9(hookPath);
@@ -77613,13 +77630,13 @@ exit 0
77613
77630
  if (!gitDir) {
77614
77631
  return { installed: [], missing: this.config.hooks };
77615
77632
  }
77616
- const hooksDir = (0, import_path49.join)(gitDir, "hooks");
77633
+ const hooksDir = (0, import_path50.join)(gitDir, "hooks");
77617
77634
  const installed = [];
77618
77635
  const missing = [];
77619
77636
  for (const hookType of this.config.hooks) {
77620
- const hookPath = (0, import_path49.join)(hooksDir, hookType);
77621
- if ((0, import_fs50.existsSync)(hookPath)) {
77622
- const content = (0, import_fs50.readFileSync)(hookPath, "utf-8");
77637
+ const hookPath = (0, import_path50.join)(hooksDir, hookType);
77638
+ if ((0, import_fs51.existsSync)(hookPath)) {
77639
+ const content = (0, import_fs51.readFileSync)(hookPath, "utf-8");
77623
77640
  if (content.includes("GAL_HOOK_MARKER")) {
77624
77641
  installed.push(hookType);
77625
77642
  } else {
@@ -77642,12 +77659,12 @@ function getFileWatcher() {
77642
77659
  }
77643
77660
  return defaultWatcher;
77644
77661
  }
77645
- var import_fs51, import_path50, DEFAULT_FILE_WATCHER_CONFIG, AGENT_CONFIG_PATTERNS, FileWatcher, defaultWatcher;
77662
+ var import_fs52, import_path51, DEFAULT_FILE_WATCHER_CONFIG, AGENT_CONFIG_PATTERNS, FileWatcher, defaultWatcher;
77646
77663
  var init_file_watcher = __esm({
77647
77664
  "module_436"() {
77648
77665
  "use strict";
77649
- import_fs51 = require("fs");
77650
- import_path50 = require("path");
77666
+ import_fs52 = require("fs");
77667
+ import_path51 = require("path");
77651
77668
  init_source();
77652
77669
  init_triggers();
77653
77670
  DEFAULT_FILE_WATCHER_CONFIG = {
@@ -77703,13 +77720,13 @@ var init_file_watcher = __esm({
77703
77720
  const watching = [];
77704
77721
  const notFound = [];
77705
77722
  for (const watchPath of this.config.watchPaths) {
77706
- const fullPath = (0, import_path50.join)(basePath, watchPath);
77707
- if (!(0, import_fs51.existsSync)(fullPath)) {
77723
+ const fullPath = (0, import_path51.join)(basePath, watchPath);
77724
+ if (!(0, import_fs52.existsSync)(fullPath)) {
77708
77725
  notFound.push(watchPath);
77709
77726
  continue;
77710
77727
  }
77711
77728
  try {
77712
- const watcher = (0, import_fs51.watch)(
77729
+ const watcher = (0, import_fs52.watch)(
77713
77730
  fullPath,
77714
77731
  { recursive: this.config.recursive },
77715
77732
  (eventType, filename) => {
@@ -77756,7 +77773,7 @@ var init_file_watcher = __esm({
77756
77773
  * @returns True if the file matches any ignore pattern and should be skipped
77757
77774
  */
77758
77775
  shouldIgnore(filename) {
77759
- const name = (0, import_path50.basename)(filename);
77776
+ const name = (0, import_path51.basename)(filename);
77760
77777
  for (const pattern of this.config.ignorePatterns) {
77761
77778
  if (pattern.startsWith("*")) {
77762
77779
  if (name.endsWith(pattern.slice(1))) {
@@ -77782,7 +77799,7 @@ var init_file_watcher = __esm({
77782
77799
  * @param filename - The name of the file that changed
77783
77800
  */
77784
77801
  handleFileEvent(eventType, watchPath, filename) {
77785
- const fullPath = (0, import_path50.join)(watchPath, filename);
77802
+ const fullPath = (0, import_path51.join)(watchPath, filename);
77786
77803
  const debounceKey = `${eventType}:${fullPath}`;
77787
77804
  const existingTimer = this.debounceTimers.get(debounceKey);
77788
77805
  if (existingTimer) {
@@ -77802,13 +77819,13 @@ var init_file_watcher = __esm({
77802
77819
  * @param filename - The name of the file that changed
77803
77820
  */
77804
77821
  async processFileEvent(eventType, watchPath, filename) {
77805
- const fullPath = (0, import_path50.join)(watchPath, filename);
77822
+ const fullPath = (0, import_path51.join)(watchPath, filename);
77806
77823
  let fsEventType;
77807
77824
  let isDirectory = false;
77808
77825
  let size;
77809
77826
  try {
77810
- if ((0, import_fs51.existsSync)(fullPath)) {
77811
- const stats = (0, import_fs51.statSync)(fullPath);
77827
+ if ((0, import_fs52.existsSync)(fullPath)) {
77828
+ const stats = (0, import_fs52.statSync)(fullPath);
77812
77829
  isDirectory = stats.isDirectory();
77813
77830
  size = stats.size;
77814
77831
  fsEventType = eventType === "rename" ? "create" : "modify";
@@ -77953,12 +77970,12 @@ var init_file_watcher = __esm({
77953
77970
  this.config.watchPaths.push(path8);
77954
77971
  return true;
77955
77972
  }
77956
- const fullPath = (0, import_path50.join)(basePath, path8);
77957
- if (!(0, import_fs51.existsSync)(fullPath)) {
77973
+ const fullPath = (0, import_path51.join)(basePath, path8);
77974
+ if (!(0, import_fs52.existsSync)(fullPath)) {
77958
77975
  return false;
77959
77976
  }
77960
77977
  try {
77961
- const watcher = (0, import_fs51.watch)(
77978
+ const watcher = (0, import_fs52.watch)(
77962
77979
  fullPath,
77963
77980
  { recursive: this.config.recursive },
77964
77981
  (eventType, filename) => {
@@ -78269,9 +78286,9 @@ async function confirm(message) {
78269
78286
  });
78270
78287
  }
78271
78288
  function isGalCreatedFile(filePath) {
78272
- if (!(0, import_fs52.existsSync)(filePath)) return false;
78289
+ if (!(0, import_fs53.existsSync)(filePath)) return false;
78273
78290
  try {
78274
- const content = (0, import_fs52.readFileSync)(filePath, "utf-8");
78291
+ const content = (0, import_fs53.readFileSync)(filePath, "utf-8");
78275
78292
  const galMarkers = [
78276
78293
  "GAL Config",
78277
78294
  "GAL CLI",
@@ -78291,9 +78308,9 @@ function isGalCreatedFile(filePath) {
78291
78308
  }
78292
78309
  }
78293
78310
  function isNpmInstalledFile(filePath) {
78294
- if (!(0, import_fs52.existsSync)(filePath)) return false;
78311
+ if (!(0, import_fs53.existsSync)(filePath)) return false;
78295
78312
  try {
78296
- const content = (0, import_fs52.readFileSync)(filePath, "utf-8");
78313
+ const content = (0, import_fs53.readFileSync)(filePath, "utf-8");
78297
78314
  return content.includes("CURRENT_VERSION =") || content.includes("const CURRENT_VERSION");
78298
78315
  } catch {
78299
78316
  return false;
@@ -78310,15 +78327,15 @@ function detectFileSource(filePath) {
78310
78327
  }
78311
78328
  function detectUserLevelItems(options) {
78312
78329
  const items = [];
78313
- const claudeDir = (0, import_path51.join)((0, import_os30.homedir)(), ".claude");
78314
- const claudeHooksDir = (0, import_path51.join)(claudeDir, "hooks");
78315
- const statusLinesDir = (0, import_path51.join)(claudeDir, "status_lines");
78330
+ const claudeDir = (0, import_path52.join)((0, import_os30.homedir)(), ".claude");
78331
+ const claudeHooksDir = (0, import_path52.join)(claudeDir, "hooks");
78332
+ const statusLinesDir = (0, import_path52.join)(claudeDir, "status_lines");
78316
78333
  const includeNpm = options?.includeNpmInstalled ?? true;
78317
- if ((0, import_fs52.existsSync)(claudeHooksDir)) {
78318
- const files = (0, import_fs52.readdirSync)(claudeHooksDir);
78334
+ if ((0, import_fs53.existsSync)(claudeHooksDir)) {
78335
+ const files = (0, import_fs53.readdirSync)(claudeHooksDir);
78319
78336
  for (const file of files) {
78320
78337
  if (file.startsWith("gal-")) {
78321
- const filePath = (0, import_path51.join)(claudeHooksDir, file);
78338
+ const filePath = (0, import_path52.join)(claudeHooksDir, file);
78322
78339
  const source = detectFileSource(filePath);
78323
78340
  if (!includeNpm && source === "npm") {
78324
78341
  continue;
@@ -78333,11 +78350,11 @@ function detectUserLevelItems(options) {
78333
78350
  }
78334
78351
  }
78335
78352
  }
78336
- if ((0, import_fs52.existsSync)(statusLinesDir)) {
78337
- const files = (0, import_fs52.readdirSync)(statusLinesDir);
78353
+ if ((0, import_fs53.existsSync)(statusLinesDir)) {
78354
+ const files = (0, import_fs53.readdirSync)(statusLinesDir);
78338
78355
  for (const file of files) {
78339
78356
  if (file.startsWith("gal-")) {
78340
- const filePath = (0, import_path51.join)(statusLinesDir, file);
78357
+ const filePath = (0, import_path52.join)(statusLinesDir, file);
78341
78358
  const source = detectFileSource(filePath);
78342
78359
  if (!includeNpm && source === "npm") {
78343
78360
  continue;
@@ -78352,10 +78369,10 @@ function detectUserLevelItems(options) {
78352
78369
  }
78353
78370
  }
78354
78371
  }
78355
- const claudeSettingsPath = (0, import_path51.join)(claudeDir, "settings.json");
78356
- if ((0, import_fs52.existsSync)(claudeSettingsPath)) {
78372
+ const claudeSettingsPath = (0, import_path52.join)(claudeDir, "settings.json");
78373
+ if ((0, import_fs53.existsSync)(claudeSettingsPath)) {
78357
78374
  try {
78358
- const settings = JSON.parse((0, import_fs52.readFileSync)(claudeSettingsPath, "utf-8"));
78375
+ const settings = JSON.parse((0, import_fs53.readFileSync)(claudeSettingsPath, "utf-8"));
78359
78376
  if (settings.hooks?.SessionStart) {
78360
78377
  const hasGalHooks = settings.hooks.SessionStart.some(
78361
78378
  (entry) => entry.hooks?.some(
@@ -78402,14 +78419,14 @@ function detectUserLevelItems(options) {
78402
78419
  } catch {
78403
78420
  }
78404
78421
  }
78405
- const cursorDir = (0, import_path51.join)((0, import_os30.homedir)(), ".cursor");
78406
- const cursorHooksDir = (0, import_path51.join)(cursorDir, "hooks");
78407
- if ((0, import_fs52.existsSync)(cursorHooksDir)) {
78408
- const files = (0, import_fs52.readdirSync)(cursorHooksDir);
78422
+ const cursorDir = (0, import_path52.join)((0, import_os30.homedir)(), ".cursor");
78423
+ const cursorHooksDir = (0, import_path52.join)(cursorDir, "hooks");
78424
+ if ((0, import_fs53.existsSync)(cursorHooksDir)) {
78425
+ const files = (0, import_fs53.readdirSync)(cursorHooksDir);
78409
78426
  for (const file of files) {
78410
78427
  if (file.startsWith("gal-")) {
78411
78428
  items.push({
78412
- path: (0, import_path51.join)(cursorHooksDir, file),
78429
+ path: (0, import_path52.join)(cursorHooksDir, file),
78413
78430
  type: "file",
78414
78431
  reason: "GAL hook file for Cursor IDE",
78415
78432
  isGalOwned: true
@@ -78417,10 +78434,10 @@ function detectUserLevelItems(options) {
78417
78434
  }
78418
78435
  }
78419
78436
  }
78420
- const cursorHooksJsonPath = (0, import_path51.join)(cursorDir, "hooks.json");
78421
- if ((0, import_fs52.existsSync)(cursorHooksJsonPath)) {
78437
+ const cursorHooksJsonPath = (0, import_path52.join)(cursorDir, "hooks.json");
78438
+ if ((0, import_fs53.existsSync)(cursorHooksJsonPath)) {
78422
78439
  try {
78423
- const hooksConfig = JSON.parse((0, import_fs52.readFileSync)(cursorHooksJsonPath, "utf-8"));
78440
+ const hooksConfig = JSON.parse((0, import_fs53.readFileSync)(cursorHooksJsonPath, "utf-8"));
78424
78441
  const hookTypes = ["beforeShellExecution", "beforeSubmitPrompt"];
78425
78442
  for (const hookType of hookTypes) {
78426
78443
  if (hooksConfig.hooks?.[hookType]) {
@@ -78446,8 +78463,8 @@ function detectUserLevelItems(options) {
78446
78463
  }
78447
78464
  function detectProjectLevelItems(directory) {
78448
78465
  const items = [];
78449
- const galDir = (0, import_path51.join)(directory, ".gal");
78450
- if ((0, import_fs52.existsSync)(galDir)) {
78466
+ const galDir = (0, import_path52.join)(directory, ".gal");
78467
+ if ((0, import_fs53.existsSync)(galDir)) {
78451
78468
  items.push({
78452
78469
  path: galDir,
78453
78470
  type: "directory",
@@ -78455,8 +78472,8 @@ function detectProjectLevelItems(directory) {
78455
78472
  isGalOwned: true
78456
78473
  });
78457
78474
  }
78458
- const galConfig = (0, import_path51.join)(directory, "gal.config.json");
78459
- if ((0, import_fs52.existsSync)(galConfig)) {
78475
+ const galConfig = (0, import_path52.join)(directory, "gal.config.json");
78476
+ if ((0, import_fs53.existsSync)(galConfig)) {
78460
78477
  items.push({
78461
78478
  path: galConfig,
78462
78479
  type: "file",
@@ -78465,11 +78482,11 @@ function detectProjectLevelItems(directory) {
78465
78482
  });
78466
78483
  }
78467
78484
  const gitHookPaths = [
78468
- (0, import_path51.join)(directory, ".git", "hooks", "pre-commit"),
78469
- (0, import_path51.join)(directory, ".husky", "pre-commit")
78485
+ (0, import_path52.join)(directory, ".git", "hooks", "pre-commit"),
78486
+ (0, import_path52.join)(directory, ".husky", "pre-commit")
78470
78487
  ];
78471
78488
  for (const hookPath of gitHookPaths) {
78472
- if ((0, import_fs52.existsSync)(hookPath) && isGalCreatedFile(hookPath)) {
78489
+ if ((0, import_fs53.existsSync)(hookPath) && isGalCreatedFile(hookPath)) {
78473
78490
  items.push({
78474
78491
  path: hookPath,
78475
78492
  type: "file",
@@ -78479,18 +78496,18 @@ function detectProjectLevelItems(directory) {
78479
78496
  }
78480
78497
  }
78481
78498
  const setupFiles = [
78482
- { path: (0, import_path51.join)(directory, "CLAUDE.md"), reason: "GAL-generated CLAUDE.md" },
78483
- { path: (0, import_path51.join)(directory, ".claude", "settings.json"), reason: "GAL-generated settings" },
78484
- { path: (0, import_path51.join)(directory, ".claude", "commands", "review.md"), reason: "GAL-generated command" },
78485
- { path: (0, import_path51.join)(directory, ".claude", "commands", "check.md"), reason: "GAL-generated command" },
78486
- { path: (0, import_path51.join)(directory, ".github", "workflows", "ci.yml"), reason: "GAL-generated workflow" },
78487
- { path: (0, import_path51.join)(directory, ".github", "workflows", "pr-governance.yml"), reason: "GAL-generated workflow" },
78488
- { path: (0, import_path51.join)(directory, ".gitleaks.toml"), reason: "GAL-generated security config" },
78489
- { path: (0, import_path51.join)(directory, "SECURITY.md"), reason: "GAL-generated security docs" },
78490
- { path: (0, import_path51.join)(directory, ".env.example"), reason: "GAL-generated env template" }
78499
+ { path: (0, import_path52.join)(directory, "CLAUDE.md"), reason: "GAL-generated CLAUDE.md" },
78500
+ { path: (0, import_path52.join)(directory, ".claude", "settings.json"), reason: "GAL-generated settings" },
78501
+ { path: (0, import_path52.join)(directory, ".claude", "commands", "review.md"), reason: "GAL-generated command" },
78502
+ { path: (0, import_path52.join)(directory, ".claude", "commands", "check.md"), reason: "GAL-generated command" },
78503
+ { path: (0, import_path52.join)(directory, ".github", "workflows", "ci.yml"), reason: "GAL-generated workflow" },
78504
+ { path: (0, import_path52.join)(directory, ".github", "workflows", "pr-governance.yml"), reason: "GAL-generated workflow" },
78505
+ { path: (0, import_path52.join)(directory, ".gitleaks.toml"), reason: "GAL-generated security config" },
78506
+ { path: (0, import_path52.join)(directory, "SECURITY.md"), reason: "GAL-generated security docs" },
78507
+ { path: (0, import_path52.join)(directory, ".env.example"), reason: "GAL-generated env template" }
78491
78508
  ];
78492
78509
  for (const { path: path8, reason } of setupFiles) {
78493
- if ((0, import_fs52.existsSync)(path8) && isGalCreatedFile(path8)) {
78510
+ if ((0, import_fs53.existsSync)(path8) && isGalCreatedFile(path8)) {
78494
78511
  items.push({
78495
78512
  path: path8,
78496
78513
  type: "file",
@@ -78503,12 +78520,12 @@ function detectProjectLevelItems(directory) {
78503
78520
  }
78504
78521
  function removeGalStatusLineEntry(settingsPath) {
78505
78522
  try {
78506
- const settings = JSON.parse((0, import_fs52.readFileSync)(settingsPath, "utf-8"));
78523
+ const settings = JSON.parse((0, import_fs53.readFileSync)(settingsPath, "utf-8"));
78507
78524
  if (!settings.statusLine?.command?.includes("gal-")) {
78508
78525
  return false;
78509
78526
  }
78510
78527
  delete settings.statusLine;
78511
- (0, import_fs52.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78528
+ (0, import_fs53.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78512
78529
  return true;
78513
78530
  } catch {
78514
78531
  return false;
@@ -78516,7 +78533,7 @@ function removeGalStatusLineEntry(settingsPath) {
78516
78533
  }
78517
78534
  function removeGalHookEntries(settingsPath) {
78518
78535
  try {
78519
- const settings = JSON.parse((0, import_fs52.readFileSync)(settingsPath, "utf-8"));
78536
+ const settings = JSON.parse((0, import_fs53.readFileSync)(settingsPath, "utf-8"));
78520
78537
  let modified = false;
78521
78538
  for (const hookEvent of ["SessionStart", "UserPromptSubmit"]) {
78522
78539
  if (!settings.hooks?.[hookEvent]) continue;
@@ -78539,7 +78556,7 @@ function removeGalHookEntries(settingsPath) {
78539
78556
  delete settings.hooks;
78540
78557
  }
78541
78558
  if (modified) {
78542
- (0, import_fs52.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78559
+ (0, import_fs53.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78543
78560
  return true;
78544
78561
  }
78545
78562
  return false;
@@ -78549,7 +78566,7 @@ function removeGalHookEntries(settingsPath) {
78549
78566
  }
78550
78567
  function removeGalCursorHookEntries(hooksJsonPath) {
78551
78568
  try {
78552
- const hooksConfig = JSON.parse((0, import_fs52.readFileSync)(hooksJsonPath, "utf-8"));
78569
+ const hooksConfig = JSON.parse((0, import_fs53.readFileSync)(hooksJsonPath, "utf-8"));
78553
78570
  if (!hooksConfig.hooks) {
78554
78571
  return false;
78555
78572
  }
@@ -78573,7 +78590,7 @@ function removeGalCursorHookEntries(hooksJsonPath) {
78573
78590
  delete hooksConfig.hooks;
78574
78591
  }
78575
78592
  if (modified) {
78576
- (0, import_fs52.writeFileSync)(hooksJsonPath, JSON.stringify(hooksConfig, null, 2));
78593
+ (0, import_fs53.writeFileSync)(hooksJsonPath, JSON.stringify(hooksConfig, null, 2));
78577
78594
  return true;
78578
78595
  }
78579
78596
  return false;
@@ -78608,10 +78625,10 @@ function performUninstall(items, dryRun) {
78608
78625
  result.skipped.push(`${item.path} (no GAL statusLine found)`);
78609
78626
  }
78610
78627
  } else if (item.type === "directory") {
78611
- (0, import_fs52.rmSync)(item.path, { recursive: true, force: true });
78628
+ (0, import_fs53.rmSync)(item.path, { recursive: true, force: true });
78612
78629
  result.removed.push(item.path);
78613
78630
  } else {
78614
- (0, import_fs52.unlinkSync)(item.path);
78631
+ (0, import_fs53.unlinkSync)(item.path);
78615
78632
  result.removed.push(item.path);
78616
78633
  }
78617
78634
  } catch (error3) {
@@ -78707,14 +78724,14 @@ function createUninstallCommand() {
78707
78724
  });
78708
78725
  return command;
78709
78726
  }
78710
- var import_fs52, import_path51, import_os30, import_readline5;
78727
+ var import_fs53, import_path52, import_os30, import_readline5;
78711
78728
  var init_uninstall = __esm({
78712
78729
  "module_438"() {
78713
78730
  "use strict";
78714
78731
  init_esm();
78715
78732
  init_source();
78716
- import_fs52 = require("fs");
78717
- import_path51 = require("path");
78733
+ import_fs53 = require("fs");
78734
+ import_path52 = require("path");
78718
78735
  import_os30 = require("os");
78719
78736
  import_readline5 = require("readline");
78720
78737
  }
@@ -79131,27 +79148,27 @@ function compareVersions2(v1, v2) {
79131
79148
  }
79132
79149
  function acquireLock() {
79133
79150
  try {
79134
- const galDir = (0, import_path52.join)((0, import_os31.homedir)(), ".gal");
79135
- if (!(0, import_fs53.existsSync)(galDir)) {
79136
- (0, import_fs53.mkdirSync)(galDir, { recursive: true });
79151
+ const galDir = (0, import_path53.join)((0, import_os31.homedir)(), ".gal");
79152
+ if (!(0, import_fs54.existsSync)(galDir)) {
79153
+ (0, import_fs54.mkdirSync)(galDir, { recursive: true });
79137
79154
  }
79138
- if ((0, import_fs53.existsSync)(UPDATE_LOCK_FILE)) {
79155
+ if ((0, import_fs54.existsSync)(UPDATE_LOCK_FILE)) {
79139
79156
  try {
79140
- const lockContent = (0, import_fs53.readFileSync)(UPDATE_LOCK_FILE, "utf-8");
79157
+ const lockContent = (0, import_fs54.readFileSync)(UPDATE_LOCK_FILE, "utf-8");
79141
79158
  const lockTime = parseInt(lockContent, 10);
79142
79159
  if (Number.isNaN(lockTime) || Date.now() - lockTime > 5 * 60 * 1e3) {
79143
- (0, import_fs53.unlinkSync)(UPDATE_LOCK_FILE);
79160
+ (0, import_fs54.unlinkSync)(UPDATE_LOCK_FILE);
79144
79161
  } else {
79145
79162
  return false;
79146
79163
  }
79147
79164
  } catch {
79148
79165
  try {
79149
- (0, import_fs53.unlinkSync)(UPDATE_LOCK_FILE);
79166
+ (0, import_fs54.unlinkSync)(UPDATE_LOCK_FILE);
79150
79167
  } catch {
79151
79168
  }
79152
79169
  }
79153
79170
  }
79154
- (0, import_fs53.writeFileSync)(UPDATE_LOCK_FILE, String(Date.now()), { flag: "wx" });
79171
+ (0, import_fs54.writeFileSync)(UPDATE_LOCK_FILE, String(Date.now()), { flag: "wx" });
79155
79172
  return true;
79156
79173
  } catch {
79157
79174
  return false;
@@ -79159,8 +79176,8 @@ function acquireLock() {
79159
79176
  }
79160
79177
  function releaseLock() {
79161
79178
  try {
79162
- if ((0, import_fs53.existsSync)(UPDATE_LOCK_FILE)) {
79163
- (0, import_fs53.unlinkSync)(UPDATE_LOCK_FILE);
79179
+ if ((0, import_fs54.existsSync)(UPDATE_LOCK_FILE)) {
79180
+ (0, import_fs54.unlinkSync)(UPDATE_LOCK_FILE);
79164
79181
  }
79165
79182
  } catch {
79166
79183
  }
@@ -79243,8 +79260,8 @@ function createUpdateCommand() {
79243
79260
  });
79244
79261
  releaseLock();
79245
79262
  try {
79246
- const cacheFile = (0, import_path52.join)((0, import_os31.homedir)(), ".gal", "update-cache.json");
79247
- if ((0, import_fs53.existsSync)(cacheFile)) (0, import_fs53.unlinkSync)(cacheFile);
79263
+ const cacheFile = (0, import_path53.join)((0, import_os31.homedir)(), ".gal", "update-cache.json");
79264
+ if ((0, import_fs54.existsSync)(cacheFile)) (0, import_fs54.unlinkSync)(cacheFile);
79248
79265
  } catch {
79249
79266
  }
79250
79267
  updateSpinner.succeed(source_default.green(`Updated to v${latestVersion}`));
@@ -79303,7 +79320,7 @@ Retry manually with: ${source_default.cyan(installCommand)}`);
79303
79320
  });
79304
79321
  return command;
79305
79322
  }
79306
- var import_https, import_child_process18, import_fs53, import_path52, import_os31, UPDATE_LOCK_FILE, cliVersion8, REGISTRY_URL;
79323
+ var import_https, import_child_process18, import_fs54, import_path53, import_os31, UPDATE_LOCK_FILE, cliVersion8, REGISTRY_URL;
79307
79324
  var init_update = __esm({
79308
79325
  "module_440"() {
79309
79326
  "use strict";
@@ -79312,14 +79329,14 @@ var init_update = __esm({
79312
79329
  init_ora();
79313
79330
  import_https = __toESM(require("https"), 1);
79314
79331
  import_child_process18 = require("child_process");
79315
- import_fs53 = require("fs");
79316
- import_path52 = require("path");
79332
+ import_fs54 = require("fs");
79333
+ import_path53 = require("path");
79317
79334
  import_os31 = require("os");
79318
79335
  init_constants();
79319
79336
  init_path_conflict();
79320
79337
  init_install();
79321
79338
  init_telemetry();
79322
- UPDATE_LOCK_FILE = (0, import_path52.join)((0, import_os31.homedir)(), ".gal", "update.lock");
79339
+ UPDATE_LOCK_FILE = (0, import_path53.join)((0, import_os31.homedir)(), ".gal", "update.lock");
79323
79340
  cliVersion8 = constants_default[0];
79324
79341
  REGISTRY_URL = getRegistryUrl();
79325
79342
  }
@@ -79825,9 +79842,9 @@ function createWorkflowCommand() {
79825
79842
  const apiUrl = process.env.GAL_API_URL || defaultApiUrl20;
79826
79843
  try {
79827
79844
  const spinner = ora(`Reading ${filePath}...`).start();
79828
- const absolutePath = import_path53.default.resolve(filePath);
79845
+ const absolutePath = import_path54.default.resolve(filePath);
79829
79846
  const content = await import_promises14.default.readFile(absolutePath, "utf-8");
79830
- const fileName = import_path53.default.basename(filePath);
79847
+ const fileName = import_path54.default.basename(filePath);
79831
79848
  let type = options.type;
79832
79849
  if (!type) {
79833
79850
  if (fileName.endsWith(".md")) {
@@ -79883,7 +79900,7 @@ function createWorkflowCommand() {
79883
79900
  spinner.fail(source_default.red("No organization found. Please connect GitHub via dashboard or use --org flag"));
79884
79901
  process.exit(1);
79885
79902
  }
79886
- const dirPath = import_path53.default.resolve(directory);
79903
+ const dirPath = import_path54.default.resolve(directory);
79887
79904
  const files = await import_promises14.default.readdir(dirPath);
79888
79905
  const workflowFiles = files.filter(
79889
79906
  (f) => f.endsWith(".md") || f.includes("hook") && (f.endsWith(".json") || f.endsWith(".py") || f.endsWith(".js"))
@@ -79895,7 +79912,7 @@ function createWorkflowCommand() {
79895
79912
  spinner.text = `Found ${workflowFiles.length} workflow files. Preparing batch test...`;
79896
79913
  const requests = [];
79897
79914
  for (const file of workflowFiles) {
79898
- const filePath = import_path53.default.join(dirPath, file);
79915
+ const filePath = import_path54.default.join(dirPath, file);
79899
79916
  const content = await import_promises14.default.readFile(filePath, "utf-8");
79900
79917
  const type = file.endsWith(".md") ? "command" : "hook";
79901
79918
  requests.push({
@@ -79993,7 +80010,7 @@ function displayTestResult(result) {
79993
80010
  }
79994
80011
  console.log();
79995
80012
  }
79996
- var import_promises14, import_path53, defaultApiUrl20;
80013
+ var import_promises14, import_path54, defaultApiUrl20;
79997
80014
  var init_workflow2 = __esm({
79998
80015
  "module_442"() {
79999
80016
  "use strict";
@@ -80001,7 +80018,7 @@ var init_workflow2 = __esm({
80001
80018
  init_source();
80002
80019
  init_ora();
80003
80020
  import_promises14 = __toESM(require("fs/promises"), 1);
80004
- import_path53 = __toESM(require("path"), 1);
80021
+ import_path54 = __toESM(require("path"), 1);
80005
80022
  init_constants();
80006
80023
  init_client();
80007
80024
  defaultApiUrl20 = constants_default[1];
@@ -80362,11 +80379,11 @@ function getRegistryAuthToken2() {
80362
80379
  return void 0;
80363
80380
  }
80364
80381
  try {
80365
- const npmrcPath = (0, import_path54.join)((0, import_os32.homedir)(), ".npmrc");
80366
- if (!(0, import_fs54.existsSync)(npmrcPath)) {
80382
+ const npmrcPath = (0, import_path55.join)((0, import_os32.homedir)(), ".npmrc");
80383
+ if (!(0, import_fs55.existsSync)(npmrcPath)) {
80367
80384
  return void 0;
80368
80385
  }
80369
- const npmrc = (0, import_fs54.readFileSync)(npmrcPath, "utf-8");
80386
+ const npmrc = (0, import_fs55.readFileSync)(npmrcPath, "utf-8");
80370
80387
  const escapedHost = REGISTRY_HOST.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
80371
80388
  const match = npmrc.match(
80372
80389
  new RegExp(`^//${escapedHost}/:_authToken=(.+)$`, "m")
@@ -80386,8 +80403,8 @@ function getRegistryAuthToken2() {
80386
80403
  }
80387
80404
  function readUpdateCache() {
80388
80405
  try {
80389
- if ((0, import_fs54.existsSync)(UPDATE_CACHE_FILE)) {
80390
- return JSON.parse((0, import_fs54.readFileSync)(UPDATE_CACHE_FILE, "utf-8"));
80406
+ if ((0, import_fs55.existsSync)(UPDATE_CACHE_FILE)) {
80407
+ return JSON.parse((0, import_fs55.readFileSync)(UPDATE_CACHE_FILE, "utf-8"));
80391
80408
  }
80392
80409
  } catch {
80393
80410
  }
@@ -80395,10 +80412,10 @@ function readUpdateCache() {
80395
80412
  }
80396
80413
  function writeUpdateCache(cache) {
80397
80414
  try {
80398
- if (!(0, import_fs54.existsSync)(UPDATE_CACHE_DIR)) {
80399
- (0, import_fs54.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80415
+ if (!(0, import_fs55.existsSync)(UPDATE_CACHE_DIR)) {
80416
+ (0, import_fs55.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80400
80417
  }
80401
- (0, import_fs54.writeFileSync)(UPDATE_CACHE_FILE, JSON.stringify(cache));
80418
+ (0, import_fs55.writeFileSync)(UPDATE_CACHE_FILE, JSON.stringify(cache));
80402
80419
  } catch {
80403
80420
  }
80404
80421
  }
@@ -80538,8 +80555,8 @@ async function checkForUpdates() {
80538
80555
  });
80539
80556
  if (!isUpdateCommand && !isCI && !isAutoUpdateDisabled) {
80540
80557
  try {
80541
- const lockFile = (0, import_path54.join)((0, import_os32.homedir)(), ".gal", "update.lock");
80542
- if (!(0, import_fs54.existsSync)(lockFile)) {
80558
+ const lockFile = (0, import_path55.join)((0, import_os32.homedir)(), ".gal", "update.lock");
80559
+ if (!(0, import_fs55.existsSync)(lockFile)) {
80543
80560
  const child = (0, import_child_process19.spawn)("gal", ["update"], {
80544
80561
  detached: true,
80545
80562
  stdio: "ignore",
@@ -80588,9 +80605,9 @@ async function checkForUpdates() {
80588
80605
  function checkPathConflicts() {
80589
80606
  try {
80590
80607
  if (process.env.CI === "true" || process.argv.includes("--json")) return;
80591
- const CONFLICT_CACHE = (0, import_path54.join)(UPDATE_CACHE_DIR, "path-conflict-cache.json");
80592
- if ((0, import_fs54.existsSync)(CONFLICT_CACHE)) {
80593
- const cached2 = JSON.parse((0, import_fs54.readFileSync)(CONFLICT_CACHE, "utf-8"));
80608
+ const CONFLICT_CACHE = (0, import_path55.join)(UPDATE_CACHE_DIR, "path-conflict-cache.json");
80609
+ if ((0, import_fs55.existsSync)(CONFLICT_CACHE)) {
80610
+ const cached2 = JSON.parse((0, import_fs55.readFileSync)(CONFLICT_CACHE, "utf-8"));
80594
80611
  if (Date.now() - (cached2.lastCheck || 0) < ONE_DAY) {
80595
80612
  if (cached2.hasConflict) {
80596
80613
  process.on("exit", () => {
@@ -80604,10 +80621,10 @@ function checkPathConflicts() {
80604
80621
  const conflict = detectPathConflict(cliVersion10);
80605
80622
  const cacheData = { lastCheck: Date.now(), hasConflict: !!conflict };
80606
80623
  try {
80607
- if (!(0, import_fs54.existsSync)(UPDATE_CACHE_DIR)) {
80608
- (0, import_fs54.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80624
+ if (!(0, import_fs55.existsSync)(UPDATE_CACHE_DIR)) {
80625
+ (0, import_fs55.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80609
80626
  }
80610
- (0, import_fs54.writeFileSync)(CONFLICT_CACHE, JSON.stringify(cacheData));
80627
+ (0, import_fs55.writeFileSync)(CONFLICT_CACHE, JSON.stringify(cacheData));
80611
80628
  } catch {
80612
80629
  }
80613
80630
  if (conflict) {
@@ -80620,9 +80637,9 @@ function checkPathConflicts() {
80620
80637
  }
80621
80638
  function refreshOrgMemberships() {
80622
80639
  try {
80623
- const configPath = (0, import_path54.join)((0, import_os32.homedir)(), ".gal", "config.json");
80624
- if (!(0, import_fs54.existsSync)(configPath)) return;
80625
- const config2 = JSON.parse((0, import_fs54.readFileSync)(configPath, "utf-8"));
80640
+ const configPath = (0, import_path55.join)((0, import_os32.homedir)(), ".gal", "config.json");
80641
+ if (!(0, import_fs55.existsSync)(configPath)) return;
80642
+ const config2 = JSON.parse((0, import_fs55.readFileSync)(configPath, "utf-8"));
80626
80643
  if (!config2.authToken) return;
80627
80644
  const checkedAt = config2.orgMembershipsCheckedAt || 0;
80628
80645
  if (Date.now() - checkedAt < ONE_DAY) return;
@@ -80654,10 +80671,10 @@ function refreshOrgMemberships() {
80654
80671
  config2.capabilities = user.capabilities;
80655
80672
  config2.capabilitiesCachedAt = Date.now();
80656
80673
  }
80657
- if (!(0, import_fs54.existsSync)(UPDATE_CACHE_DIR)) {
80658
- (0, import_fs54.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80674
+ if (!(0, import_fs55.existsSync)(UPDATE_CACHE_DIR)) {
80675
+ (0, import_fs55.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80659
80676
  }
80660
- (0, import_fs54.writeFileSync)(configPath, JSON.stringify(config2, null, 2));
80677
+ (0, import_fs55.writeFileSync)(configPath, JSON.stringify(config2, null, 2));
80661
80678
  }
80662
80679
  } catch {
80663
80680
  }
@@ -80684,11 +80701,11 @@ function refreshOrgMemberships() {
80684
80701
  if (res.statusCode !== 200) return;
80685
80702
  const flags = JSON.parse(data);
80686
80703
  if (flags.orgAudienceTierMap) {
80687
- const freshConfig = JSON.parse((0, import_fs54.readFileSync)(configPath, "utf-8"));
80704
+ const freshConfig = JSON.parse((0, import_fs55.readFileSync)(configPath, "utf-8"));
80688
80705
  freshConfig.orgAudienceTierMap = flags.orgAudienceTierMap;
80689
80706
  freshConfig.orgPlanMap = flags.orgPlanMap || freshConfig.orgPlanMap || {};
80690
80707
  freshConfig.flagsCachedAt = Date.now();
80691
- (0, import_fs54.writeFileSync)(configPath, JSON.stringify(freshConfig, null, 2));
80708
+ (0, import_fs55.writeFileSync)(configPath, JSON.stringify(freshConfig, null, 2));
80692
80709
  }
80693
80710
  } catch {
80694
80711
  }
@@ -80718,7 +80735,7 @@ function getRequestedCommand(argv) {
80718
80735
  }
80719
80736
  return null;
80720
80737
  }
80721
- var import_dotenv, import_https2, import_readline6, import_child_process19, import_fs54, import_path54, import_os32, originalEmit, cliVersion10, fatalErrorHandled, UPDATE_CACHE_DIR, UPDATE_CACHE_FILE, ONE_DAY, REGISTRY_URL2, REGISTRY_HOST, sessionStartTime, isReadOnlyStatusCommand, isMachineMode, exitHooksRan, featureFlags, knownCommands, isKnownCommand, program2, allInternalFlags;
80738
+ var import_dotenv, import_https2, import_readline6, import_child_process19, import_fs55, import_path55, import_os32, originalEmit, cliVersion10, fatalErrorHandled, UPDATE_CACHE_DIR, UPDATE_CACHE_FILE, ONE_DAY, REGISTRY_URL2, REGISTRY_HOST, sessionStartTime, isReadOnlyStatusCommand, isMachineMode, exitHooksRan, featureFlags, knownCommands, isKnownCommand, program2, allInternalFlags;
80722
80739
  var init_index = __esm({
80723
80740
  "module_446"() {
80724
80741
  "use strict";
@@ -80727,8 +80744,8 @@ var init_index = __esm({
80727
80744
  import_https2 = __toESM(require("https"), 1);
80728
80745
  import_readline6 = __toESM(require("readline"), 1);
80729
80746
  import_child_process19 = require("child_process");
80730
- import_fs54 = require("fs");
80731
- import_path54 = require("path");
80747
+ import_fs55 = require("fs");
80748
+ import_path55 = require("path");
80732
80749
  import_os32 = require("os");
80733
80750
  init_source();
80734
80751
  init_constants();
@@ -80778,8 +80795,8 @@ var init_index = __esm({
80778
80795
  process.once("unhandledRejection", (error3) => {
80779
80796
  handleFatalCliError(error3);
80780
80797
  });
80781
- UPDATE_CACHE_DIR = (0, import_path54.join)((0, import_os32.homedir)(), ".gal");
80782
- UPDATE_CACHE_FILE = (0, import_path54.join)(UPDATE_CACHE_DIR, "update-cache.json");
80798
+ UPDATE_CACHE_DIR = (0, import_path55.join)((0, import_os32.homedir)(), ".gal");
80799
+ UPDATE_CACHE_FILE = (0, import_path55.join)(UPDATE_CACHE_DIR, "update-cache.json");
80783
80800
  ONE_DAY = 24 * 60 * 60 * 1e3;
80784
80801
  REGISTRY_URL2 = (() => {
80785
80802
  const raw = process.env.GAL_REGISTRY_URL || "https://registry.npmjs.org";
@@ -80935,7 +80952,7 @@ var init_index = __esm({
80935
80952
  }
80936
80953
  });
80937
80954
 
80938
- var cliVersion11 = true ? "0.0.564" : "0.0.0-dev";
80955
+ var cliVersion11 = true ? "0.0.566" : "0.0.0-dev";
80939
80956
  var args = process.argv.slice(2);
80940
80957
  var requestedGlobalHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
80941
80958
  var requestedVersion = args.length === 1 && (args[0] === "--version" || args[0] === "-V");
@@ -420,7 +420,8 @@ if (state && state.lastSyncHash !== state.approvedConfigHash) {
420
420
 
421
421
  if (state && state.lastSyncHash !== state.approvedConfigHash) {
422
422
  const days = Math.floor((Date.now() - new Date(state.lastSyncTimestamp).getTime()) / (24 * 60 * 60 * 1000));
423
- showMessage(\`⚠️ GAL: Config is \${days} day(s) behind \${state.organization}'s approved version.\\nRun: gal sync --pull\`, 'config_outdated');
423
+ const daysText = days === 0 ? 'less than a day' : days === 1 ? '1 day' : \`\${days} days\`;
424
+ showMessage(\`⚠️ GAL: Config is \${daysText} behind \${state.organization}'s approved version.\\nRun: gal sync --pull\`, 'config_outdated');
424
425
  }
425
426
  }
426
427
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scheduler-systems/gal-run",
3
- "version": "0.0.564",
3
+ "version": "0.0.566",
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,