@scheduler-systems/gal-run 0.0.564 → 0.0.565

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.565" : "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.565" : 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.565" : "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
  );
@@ -60589,7 +60590,9 @@ function getRemovedGalCodeAuthCommandError(command) {
60589
60590
  }
60590
60591
  function createCodeCommand() {
60591
60592
  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();
60593
+ const rawForwardedArgs = getForwardedArgs();
60594
+ const noTelemetryFlag = rawForwardedArgs.includes("--no-telemetry");
60595
+ const forwardedArgs = rawForwardedArgs.filter((arg) => arg !== "--no-telemetry");
60593
60596
  if (isGalCodeAuthCommand(forwardedArgs)) {
60594
60597
  console.error(source_default.red(getRemovedGalCodeAuthCommandError(forwardedArgs[0])));
60595
60598
  process.exit(1);
@@ -60643,9 +60646,13 @@ function createCodeCommand() {
60643
60646
  }
60644
60647
  const config2 = ConfigManager.load();
60645
60648
  let collectionEnabled = false;
60646
- try {
60647
- collectionEnabled = await resolveGalCodeSessionCollectionEnabled(config2);
60648
- } catch {
60649
+ if (noTelemetryFlag) {
60650
+ collectionEnabled = false;
60651
+ } else {
60652
+ try {
60653
+ collectionEnabled = await resolveGalCodeSessionCollectionEnabled(config2);
60654
+ } catch {
60655
+ }
60649
60656
  }
60650
60657
  const startedAt = /* @__PURE__ */ new Date();
60651
60658
  let exitCode = 0;
@@ -66457,13 +66464,13 @@ function getGitEmail() {
66457
66464
  }
66458
66465
  async function getLocalEnforcementStatus() {
66459
66466
  const { stat: stat6, readFile: readFile7 } = await import("node:fs/promises");
66460
- const { join: join64 } = await import("node:path");
66467
+ const { join: join65 } = await import("node:path");
66461
66468
  const platforms = [];
66462
66469
  let version2 = "0.0.0";
66463
66470
  let policyVersion = "0.0.0";
66464
66471
  const platformDirs = [".claude", ".cursor", ".gemini", ".codex", ".windsurf"];
66465
66472
  for (const dir of platformDirs) {
66466
- const hookPath = join64(process.cwd(), dir, "hooks", "gal-safety-hook.py");
66473
+ const hookPath = join65(process.cwd(), dir, "hooks", "gal-safety-hook.py");
66467
66474
  try {
66468
66475
  await stat6(hookPath);
66469
66476
  platforms.push(dir.replace(".", ""));
@@ -66476,7 +66483,7 @@ async function getLocalEnforcementStatus() {
66476
66483
  }
66477
66484
  }
66478
66485
  try {
66479
- const pkgPath = join64(import_meta2.url.replace("file://", ""), "..", "..", "..", "package.json");
66486
+ const pkgPath = join65(import_meta2.url.replace("file://", ""), "..", "..", "..", "package.json");
66480
66487
  const pkg = JSON.parse(await readFile7(pkgPath, "utf-8"));
66481
66488
  version2 = pkg.version || "0.1.0";
66482
66489
  } catch {
@@ -67783,7 +67790,7 @@ if __name__ == '__main__':
67783
67790
  `;
67784
67791
  }
67785
67792
  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) => {
67793
+ 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
67794
  const spinner = ora();
67788
67795
  if (!options.code) {
67789
67796
  console.log(source_default.bold("\nGAL Developer Onboarding\n"));
@@ -67899,7 +67906,7 @@ Error: ${useResult.error || "Unknown error"}`));
67899
67906
  process.exit(1);
67900
67907
  }
67901
67908
  });
67902
- return join64;
67909
+ return join65;
67903
67910
  }
67904
67911
  var import_node_os5, import_node_child_process2, import_node_crypto3, import_promises7, import_node_path5, defaultApiUrl10;
67905
67912
  var init_join = __esm({
@@ -75390,9 +75397,10 @@ var init_session_overlay = __esm({
75390
75397
 
75391
75398
  function resolveOrgName(env2) {
75392
75399
  try {
75393
- const configPath = resolveGalHomeDir(env2);
75394
- const cm = new ConfigManager(configPath);
75395
- const config2 = cm.getAll();
75400
+ const configPath = (0, import_path48.join)(resolveGalHomeDir(env2), "config.json");
75401
+ if (!(0, import_fs49.existsSync)(configPath)) return "unknown";
75402
+ const config2 = JSON.parse((0, import_fs49.readFileSync)(configPath, "utf-8"));
75403
+ if (config2.defaultOrg) return config2.defaultOrg;
75396
75404
  const orgs = config2.orgMemberships ?? [];
75397
75405
  return orgs[0] ?? "unknown";
75398
75406
  } catch {
@@ -75438,11 +75446,10 @@ async function runSession(cli, args2) {
75438
75446
  let pty;
75439
75447
  try {
75440
75448
  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"));
75449
+ } catch {
75450
+ console.error(source_default.red(
75451
+ "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"
75452
+ ));
75446
75453
  process.exit(1);
75447
75454
  }
75448
75455
  let ptyProcess;
@@ -75535,13 +75542,14 @@ async function runSession(cli, args2) {
75535
75542
  removeScrollRegion(write, rows);
75536
75543
  process.exit(exitCode);
75537
75544
  }
75538
- var CTRL_G;
75545
+ var import_fs49, import_path48, CTRL_G;
75539
75546
  var init_session2 = __esm({
75540
75547
  "module_428"() {
75541
75548
  "use strict";
75542
75549
  init_esm();
75543
75550
  init_source();
75544
- init_config_manager();
75551
+ import_fs49 = require("fs");
75552
+ import_path48 = require("path");
75545
75553
  init_gal_home();
75546
75554
  init_session_status_bar();
75547
75555
  init_session_overlay();
@@ -75550,10 +75558,10 @@ var init_session2 = __esm({
75550
75558
  });
75551
75559
 
75552
75560
  function readTermsAcceptance() {
75553
- const configFile = (0, import_path48.join)((0, import_os29.homedir)(), ".gal", "config.json");
75561
+ const configFile = (0, import_path49.join)((0, import_os29.homedir)(), ".gal", "config.json");
75554
75562
  try {
75555
- if ((0, import_fs49.existsSync)(configFile)) {
75556
- const raw = JSON.parse((0, import_fs49.readFileSync)(configFile, "utf-8"));
75563
+ if ((0, import_fs50.existsSync)(configFile)) {
75564
+ const raw = JSON.parse((0, import_fs50.readFileSync)(configFile, "utf-8"));
75557
75565
  if (typeof raw.termsAcceptedAt === "string" && raw.termsAcceptedAt.length > 0) {
75558
75566
  return { accepted: true, acceptedAt: raw.termsAcceptedAt };
75559
75567
  }
@@ -75756,7 +75764,7 @@ function displayStatusJson(result, health) {
75756
75764
  }
75757
75765
  function isRateLimited(projectId) {
75758
75766
  try {
75759
- const raw = (0, import_fs49.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75767
+ const raw = (0, import_fs50.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75760
75768
  const cache = JSON.parse(raw);
75761
75769
  const lastReport = cache[projectId];
75762
75770
  if (lastReport && Date.now() - lastReport < RATE_LIMIT_MS) {
@@ -75770,13 +75778,13 @@ function recordReport(projectId) {
75770
75778
  try {
75771
75779
  let cache = {};
75772
75780
  try {
75773
- const raw = (0, import_fs49.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75781
+ const raw = (0, import_fs50.readFileSync)(DRIFT_REPORT_CACHE_PATH, "utf-8");
75774
75782
  cache = JSON.parse(raw);
75775
75783
  } catch {
75776
75784
  }
75777
75785
  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));
75786
+ (0, import_fs50.mkdirSync)((0, import_path49.join)((0, import_os29.homedir)(), ".gal"), { recursive: true });
75787
+ (0, import_fs50.writeFileSync)(DRIFT_REPORT_CACHE_PATH, JSON.stringify(cache));
75780
75788
  } catch {
75781
75789
  }
75782
75790
  }
@@ -75922,16 +75930,16 @@ function createStatusCommand3() {
75922
75930
  });
75923
75931
  return command;
75924
75932
  }
75925
- var import_path48, import_os29, import_fs49, cliVersion7, defaultApiUrl18, PLATFORM_LABELS2, RATE_LIMIT_MS, DRIFT_REPORT_CACHE_PATH;
75933
+ var import_path49, import_os29, import_fs50, cliVersion7, defaultApiUrl18, PLATFORM_LABELS2, RATE_LIMIT_MS, DRIFT_REPORT_CACHE_PATH;
75926
75934
  var init_status = __esm({
75927
75935
  "module_429"() {
75928
75936
  "use strict";
75929
75937
  init_esm();
75930
75938
  init_source();
75931
75939
  init_ora();
75932
- import_path48 = require("path");
75940
+ import_path49 = require("path");
75933
75941
  import_os29 = require("os");
75934
- import_fs49 = require("fs");
75942
+ import_fs50 = require("fs");
75935
75943
  init_gal_config_service();
75936
75944
  init_config_manager();
75937
75945
  init_CoreServiceProvider();
@@ -75948,7 +75956,7 @@ var init_status = __esm({
75948
75956
  ])
75949
75957
  );
75950
75958
  RATE_LIMIT_MS = 5 * 60 * 1e3;
75951
- DRIFT_REPORT_CACHE_PATH = (0, import_path48.join)((0, import_os29.homedir)(), ".gal", "drift-report-cache.json");
75959
+ DRIFT_REPORT_CACHE_PATH = (0, import_path49.join)((0, import_os29.homedir)(), ".gal", "drift-report-cache.json");
75952
75960
  }
75953
75961
  });
75954
75962
 
@@ -77270,13 +77278,13 @@ function getGitHookManager() {
77270
77278
  }
77271
77279
  return defaultManager;
77272
77280
  }
77273
- var import_child_process17, import_fs50, import_path49, DEFAULT_GIT_HOOK_CONFIG, GitHookManager, defaultManager;
77281
+ var import_child_process17, import_fs51, import_path50, DEFAULT_GIT_HOOK_CONFIG, GitHookManager, defaultManager;
77274
77282
  var init_git_hooks = __esm({
77275
77283
  "module_435"() {
77276
77284
  "use strict";
77277
77285
  import_child_process17 = require("child_process");
77278
- import_fs50 = require("fs");
77279
- import_path49 = require("path");
77286
+ import_fs51 = require("fs");
77287
+ import_path50 = require("path");
77280
77288
  init_source();
77281
77289
  init_triggers();
77282
77290
  DEFAULT_GIT_HOOK_CONFIG = {
@@ -77319,12 +77327,12 @@ var init_git_hooks = __esm({
77319
77327
  if (this.gitDir) return this.gitDir;
77320
77328
  let currentPath = startPath;
77321
77329
  while (currentPath !== "/") {
77322
- const gitPath = (0, import_path49.join)(currentPath, ".git");
77323
- if ((0, import_fs50.existsSync)(gitPath)) {
77330
+ const gitPath = (0, import_path50.join)(currentPath, ".git");
77331
+ if ((0, import_fs51.existsSync)(gitPath)) {
77324
77332
  this.gitDir = gitPath;
77325
77333
  return gitPath;
77326
77334
  }
77327
- currentPath = (0, import_path49.dirname)(currentPath);
77335
+ currentPath = (0, import_path50.dirname)(currentPath);
77328
77336
  }
77329
77337
  return null;
77330
77338
  }
@@ -77346,29 +77354,29 @@ var init_git_hooks = __esm({
77346
77354
  ]
77347
77355
  };
77348
77356
  }
77349
- const hooksDir = (0, import_path49.join)(gitDir, "hooks");
77350
- if (!(0, import_fs50.existsSync)(hooksDir)) {
77351
- (0, import_fs50.mkdirSync)(hooksDir, { recursive: true });
77357
+ const hooksDir = (0, import_path50.join)(gitDir, "hooks");
77358
+ if (!(0, import_fs51.existsSync)(hooksDir)) {
77359
+ (0, import_fs51.mkdirSync)(hooksDir, { recursive: true });
77352
77360
  }
77353
77361
  const installed = [];
77354
77362
  const skipped = [];
77355
77363
  const warnings = [];
77356
77364
  for (const hookType of this.config.hooks) {
77357
- const hookPath = (0, import_path49.join)(hooksDir, hookType);
77365
+ const hookPath = (0, import_path50.join)(hooksDir, hookType);
77358
77366
  const hookScript = this.generateHookScript(hookType);
77359
- if ((0, import_fs50.existsSync)(hookPath)) {
77360
- const existing = (0, import_fs50.readFileSync)(hookPath, "utf-8");
77367
+ if ((0, import_fs51.existsSync)(hookPath)) {
77368
+ const existing = (0, import_fs51.readFileSync)(hookPath, "utf-8");
77361
77369
  if (existing.includes("GAL_HOOK_MARKER")) {
77362
- (0, import_fs50.writeFileSync)(hookPath, hookScript);
77363
- (0, import_fs50.chmodSync)(hookPath, "755");
77370
+ (0, import_fs51.writeFileSync)(hookPath, hookScript);
77371
+ (0, import_fs51.chmodSync)(hookPath, "755");
77364
77372
  installed.push(hookType);
77365
77373
  } else {
77366
77374
  console.log(source_default.yellow(`Skipping ${hookType}: existing hook found`));
77367
77375
  skipped.push(hookType);
77368
77376
  }
77369
77377
  } else {
77370
- (0, import_fs50.writeFileSync)(hookPath, hookScript);
77371
- (0, import_fs50.chmodSync)(hookPath, "755");
77378
+ (0, import_fs51.writeFileSync)(hookPath, hookScript);
77379
+ (0, import_fs51.chmodSync)(hookPath, "755");
77372
77380
  installed.push(hookType);
77373
77381
  }
77374
77382
  }
@@ -77385,12 +77393,12 @@ var init_git_hooks = __esm({
77385
77393
  if (!gitDir) {
77386
77394
  return [];
77387
77395
  }
77388
- const hooksDir = (0, import_path49.join)(gitDir, "hooks");
77396
+ const hooksDir = (0, import_path50.join)(gitDir, "hooks");
77389
77397
  const removed = [];
77390
77398
  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");
77399
+ const hookPath = (0, import_path50.join)(hooksDir, hookType);
77400
+ if ((0, import_fs51.existsSync)(hookPath)) {
77401
+ const content = (0, import_fs51.readFileSync)(hookPath, "utf-8");
77394
77402
  if (content.includes("GAL_HOOK_MARKER")) {
77395
77403
  const { unlinkSync: unlinkSync9 } = require("fs");
77396
77404
  unlinkSync9(hookPath);
@@ -77613,13 +77621,13 @@ exit 0
77613
77621
  if (!gitDir) {
77614
77622
  return { installed: [], missing: this.config.hooks };
77615
77623
  }
77616
- const hooksDir = (0, import_path49.join)(gitDir, "hooks");
77624
+ const hooksDir = (0, import_path50.join)(gitDir, "hooks");
77617
77625
  const installed = [];
77618
77626
  const missing = [];
77619
77627
  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");
77628
+ const hookPath = (0, import_path50.join)(hooksDir, hookType);
77629
+ if ((0, import_fs51.existsSync)(hookPath)) {
77630
+ const content = (0, import_fs51.readFileSync)(hookPath, "utf-8");
77623
77631
  if (content.includes("GAL_HOOK_MARKER")) {
77624
77632
  installed.push(hookType);
77625
77633
  } else {
@@ -77642,12 +77650,12 @@ function getFileWatcher() {
77642
77650
  }
77643
77651
  return defaultWatcher;
77644
77652
  }
77645
- var import_fs51, import_path50, DEFAULT_FILE_WATCHER_CONFIG, AGENT_CONFIG_PATTERNS, FileWatcher, defaultWatcher;
77653
+ var import_fs52, import_path51, DEFAULT_FILE_WATCHER_CONFIG, AGENT_CONFIG_PATTERNS, FileWatcher, defaultWatcher;
77646
77654
  var init_file_watcher = __esm({
77647
77655
  "module_436"() {
77648
77656
  "use strict";
77649
- import_fs51 = require("fs");
77650
- import_path50 = require("path");
77657
+ import_fs52 = require("fs");
77658
+ import_path51 = require("path");
77651
77659
  init_source();
77652
77660
  init_triggers();
77653
77661
  DEFAULT_FILE_WATCHER_CONFIG = {
@@ -77703,13 +77711,13 @@ var init_file_watcher = __esm({
77703
77711
  const watching = [];
77704
77712
  const notFound = [];
77705
77713
  for (const watchPath of this.config.watchPaths) {
77706
- const fullPath = (0, import_path50.join)(basePath, watchPath);
77707
- if (!(0, import_fs51.existsSync)(fullPath)) {
77714
+ const fullPath = (0, import_path51.join)(basePath, watchPath);
77715
+ if (!(0, import_fs52.existsSync)(fullPath)) {
77708
77716
  notFound.push(watchPath);
77709
77717
  continue;
77710
77718
  }
77711
77719
  try {
77712
- const watcher = (0, import_fs51.watch)(
77720
+ const watcher = (0, import_fs52.watch)(
77713
77721
  fullPath,
77714
77722
  { recursive: this.config.recursive },
77715
77723
  (eventType, filename) => {
@@ -77756,7 +77764,7 @@ var init_file_watcher = __esm({
77756
77764
  * @returns True if the file matches any ignore pattern and should be skipped
77757
77765
  */
77758
77766
  shouldIgnore(filename) {
77759
- const name = (0, import_path50.basename)(filename);
77767
+ const name = (0, import_path51.basename)(filename);
77760
77768
  for (const pattern of this.config.ignorePatterns) {
77761
77769
  if (pattern.startsWith("*")) {
77762
77770
  if (name.endsWith(pattern.slice(1))) {
@@ -77782,7 +77790,7 @@ var init_file_watcher = __esm({
77782
77790
  * @param filename - The name of the file that changed
77783
77791
  */
77784
77792
  handleFileEvent(eventType, watchPath, filename) {
77785
- const fullPath = (0, import_path50.join)(watchPath, filename);
77793
+ const fullPath = (0, import_path51.join)(watchPath, filename);
77786
77794
  const debounceKey = `${eventType}:${fullPath}`;
77787
77795
  const existingTimer = this.debounceTimers.get(debounceKey);
77788
77796
  if (existingTimer) {
@@ -77802,13 +77810,13 @@ var init_file_watcher = __esm({
77802
77810
  * @param filename - The name of the file that changed
77803
77811
  */
77804
77812
  async processFileEvent(eventType, watchPath, filename) {
77805
- const fullPath = (0, import_path50.join)(watchPath, filename);
77813
+ const fullPath = (0, import_path51.join)(watchPath, filename);
77806
77814
  let fsEventType;
77807
77815
  let isDirectory = false;
77808
77816
  let size;
77809
77817
  try {
77810
- if ((0, import_fs51.existsSync)(fullPath)) {
77811
- const stats = (0, import_fs51.statSync)(fullPath);
77818
+ if ((0, import_fs52.existsSync)(fullPath)) {
77819
+ const stats = (0, import_fs52.statSync)(fullPath);
77812
77820
  isDirectory = stats.isDirectory();
77813
77821
  size = stats.size;
77814
77822
  fsEventType = eventType === "rename" ? "create" : "modify";
@@ -77953,12 +77961,12 @@ var init_file_watcher = __esm({
77953
77961
  this.config.watchPaths.push(path8);
77954
77962
  return true;
77955
77963
  }
77956
- const fullPath = (0, import_path50.join)(basePath, path8);
77957
- if (!(0, import_fs51.existsSync)(fullPath)) {
77964
+ const fullPath = (0, import_path51.join)(basePath, path8);
77965
+ if (!(0, import_fs52.existsSync)(fullPath)) {
77958
77966
  return false;
77959
77967
  }
77960
77968
  try {
77961
- const watcher = (0, import_fs51.watch)(
77969
+ const watcher = (0, import_fs52.watch)(
77962
77970
  fullPath,
77963
77971
  { recursive: this.config.recursive },
77964
77972
  (eventType, filename) => {
@@ -78269,9 +78277,9 @@ async function confirm(message) {
78269
78277
  });
78270
78278
  }
78271
78279
  function isGalCreatedFile(filePath) {
78272
- if (!(0, import_fs52.existsSync)(filePath)) return false;
78280
+ if (!(0, import_fs53.existsSync)(filePath)) return false;
78273
78281
  try {
78274
- const content = (0, import_fs52.readFileSync)(filePath, "utf-8");
78282
+ const content = (0, import_fs53.readFileSync)(filePath, "utf-8");
78275
78283
  const galMarkers = [
78276
78284
  "GAL Config",
78277
78285
  "GAL CLI",
@@ -78291,9 +78299,9 @@ function isGalCreatedFile(filePath) {
78291
78299
  }
78292
78300
  }
78293
78301
  function isNpmInstalledFile(filePath) {
78294
- if (!(0, import_fs52.existsSync)(filePath)) return false;
78302
+ if (!(0, import_fs53.existsSync)(filePath)) return false;
78295
78303
  try {
78296
- const content = (0, import_fs52.readFileSync)(filePath, "utf-8");
78304
+ const content = (0, import_fs53.readFileSync)(filePath, "utf-8");
78297
78305
  return content.includes("CURRENT_VERSION =") || content.includes("const CURRENT_VERSION");
78298
78306
  } catch {
78299
78307
  return false;
@@ -78310,15 +78318,15 @@ function detectFileSource(filePath) {
78310
78318
  }
78311
78319
  function detectUserLevelItems(options) {
78312
78320
  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");
78321
+ const claudeDir = (0, import_path52.join)((0, import_os30.homedir)(), ".claude");
78322
+ const claudeHooksDir = (0, import_path52.join)(claudeDir, "hooks");
78323
+ const statusLinesDir = (0, import_path52.join)(claudeDir, "status_lines");
78316
78324
  const includeNpm = options?.includeNpmInstalled ?? true;
78317
- if ((0, import_fs52.existsSync)(claudeHooksDir)) {
78318
- const files = (0, import_fs52.readdirSync)(claudeHooksDir);
78325
+ if ((0, import_fs53.existsSync)(claudeHooksDir)) {
78326
+ const files = (0, import_fs53.readdirSync)(claudeHooksDir);
78319
78327
  for (const file of files) {
78320
78328
  if (file.startsWith("gal-")) {
78321
- const filePath = (0, import_path51.join)(claudeHooksDir, file);
78329
+ const filePath = (0, import_path52.join)(claudeHooksDir, file);
78322
78330
  const source = detectFileSource(filePath);
78323
78331
  if (!includeNpm && source === "npm") {
78324
78332
  continue;
@@ -78333,11 +78341,11 @@ function detectUserLevelItems(options) {
78333
78341
  }
78334
78342
  }
78335
78343
  }
78336
- if ((0, import_fs52.existsSync)(statusLinesDir)) {
78337
- const files = (0, import_fs52.readdirSync)(statusLinesDir);
78344
+ if ((0, import_fs53.existsSync)(statusLinesDir)) {
78345
+ const files = (0, import_fs53.readdirSync)(statusLinesDir);
78338
78346
  for (const file of files) {
78339
78347
  if (file.startsWith("gal-")) {
78340
- const filePath = (0, import_path51.join)(statusLinesDir, file);
78348
+ const filePath = (0, import_path52.join)(statusLinesDir, file);
78341
78349
  const source = detectFileSource(filePath);
78342
78350
  if (!includeNpm && source === "npm") {
78343
78351
  continue;
@@ -78352,10 +78360,10 @@ function detectUserLevelItems(options) {
78352
78360
  }
78353
78361
  }
78354
78362
  }
78355
- const claudeSettingsPath = (0, import_path51.join)(claudeDir, "settings.json");
78356
- if ((0, import_fs52.existsSync)(claudeSettingsPath)) {
78363
+ const claudeSettingsPath = (0, import_path52.join)(claudeDir, "settings.json");
78364
+ if ((0, import_fs53.existsSync)(claudeSettingsPath)) {
78357
78365
  try {
78358
- const settings = JSON.parse((0, import_fs52.readFileSync)(claudeSettingsPath, "utf-8"));
78366
+ const settings = JSON.parse((0, import_fs53.readFileSync)(claudeSettingsPath, "utf-8"));
78359
78367
  if (settings.hooks?.SessionStart) {
78360
78368
  const hasGalHooks = settings.hooks.SessionStart.some(
78361
78369
  (entry) => entry.hooks?.some(
@@ -78402,14 +78410,14 @@ function detectUserLevelItems(options) {
78402
78410
  } catch {
78403
78411
  }
78404
78412
  }
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);
78413
+ const cursorDir = (0, import_path52.join)((0, import_os30.homedir)(), ".cursor");
78414
+ const cursorHooksDir = (0, import_path52.join)(cursorDir, "hooks");
78415
+ if ((0, import_fs53.existsSync)(cursorHooksDir)) {
78416
+ const files = (0, import_fs53.readdirSync)(cursorHooksDir);
78409
78417
  for (const file of files) {
78410
78418
  if (file.startsWith("gal-")) {
78411
78419
  items.push({
78412
- path: (0, import_path51.join)(cursorHooksDir, file),
78420
+ path: (0, import_path52.join)(cursorHooksDir, file),
78413
78421
  type: "file",
78414
78422
  reason: "GAL hook file for Cursor IDE",
78415
78423
  isGalOwned: true
@@ -78417,10 +78425,10 @@ function detectUserLevelItems(options) {
78417
78425
  }
78418
78426
  }
78419
78427
  }
78420
- const cursorHooksJsonPath = (0, import_path51.join)(cursorDir, "hooks.json");
78421
- if ((0, import_fs52.existsSync)(cursorHooksJsonPath)) {
78428
+ const cursorHooksJsonPath = (0, import_path52.join)(cursorDir, "hooks.json");
78429
+ if ((0, import_fs53.existsSync)(cursorHooksJsonPath)) {
78422
78430
  try {
78423
- const hooksConfig = JSON.parse((0, import_fs52.readFileSync)(cursorHooksJsonPath, "utf-8"));
78431
+ const hooksConfig = JSON.parse((0, import_fs53.readFileSync)(cursorHooksJsonPath, "utf-8"));
78424
78432
  const hookTypes = ["beforeShellExecution", "beforeSubmitPrompt"];
78425
78433
  for (const hookType of hookTypes) {
78426
78434
  if (hooksConfig.hooks?.[hookType]) {
@@ -78446,8 +78454,8 @@ function detectUserLevelItems(options) {
78446
78454
  }
78447
78455
  function detectProjectLevelItems(directory) {
78448
78456
  const items = [];
78449
- const galDir = (0, import_path51.join)(directory, ".gal");
78450
- if ((0, import_fs52.existsSync)(galDir)) {
78457
+ const galDir = (0, import_path52.join)(directory, ".gal");
78458
+ if ((0, import_fs53.existsSync)(galDir)) {
78451
78459
  items.push({
78452
78460
  path: galDir,
78453
78461
  type: "directory",
@@ -78455,8 +78463,8 @@ function detectProjectLevelItems(directory) {
78455
78463
  isGalOwned: true
78456
78464
  });
78457
78465
  }
78458
- const galConfig = (0, import_path51.join)(directory, "gal.config.json");
78459
- if ((0, import_fs52.existsSync)(galConfig)) {
78466
+ const galConfig = (0, import_path52.join)(directory, "gal.config.json");
78467
+ if ((0, import_fs53.existsSync)(galConfig)) {
78460
78468
  items.push({
78461
78469
  path: galConfig,
78462
78470
  type: "file",
@@ -78465,11 +78473,11 @@ function detectProjectLevelItems(directory) {
78465
78473
  });
78466
78474
  }
78467
78475
  const gitHookPaths = [
78468
- (0, import_path51.join)(directory, ".git", "hooks", "pre-commit"),
78469
- (0, import_path51.join)(directory, ".husky", "pre-commit")
78476
+ (0, import_path52.join)(directory, ".git", "hooks", "pre-commit"),
78477
+ (0, import_path52.join)(directory, ".husky", "pre-commit")
78470
78478
  ];
78471
78479
  for (const hookPath of gitHookPaths) {
78472
- if ((0, import_fs52.existsSync)(hookPath) && isGalCreatedFile(hookPath)) {
78480
+ if ((0, import_fs53.existsSync)(hookPath) && isGalCreatedFile(hookPath)) {
78473
78481
  items.push({
78474
78482
  path: hookPath,
78475
78483
  type: "file",
@@ -78479,18 +78487,18 @@ function detectProjectLevelItems(directory) {
78479
78487
  }
78480
78488
  }
78481
78489
  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" }
78490
+ { path: (0, import_path52.join)(directory, "CLAUDE.md"), reason: "GAL-generated CLAUDE.md" },
78491
+ { path: (0, import_path52.join)(directory, ".claude", "settings.json"), reason: "GAL-generated settings" },
78492
+ { path: (0, import_path52.join)(directory, ".claude", "commands", "review.md"), reason: "GAL-generated command" },
78493
+ { path: (0, import_path52.join)(directory, ".claude", "commands", "check.md"), reason: "GAL-generated command" },
78494
+ { path: (0, import_path52.join)(directory, ".github", "workflows", "ci.yml"), reason: "GAL-generated workflow" },
78495
+ { path: (0, import_path52.join)(directory, ".github", "workflows", "pr-governance.yml"), reason: "GAL-generated workflow" },
78496
+ { path: (0, import_path52.join)(directory, ".gitleaks.toml"), reason: "GAL-generated security config" },
78497
+ { path: (0, import_path52.join)(directory, "SECURITY.md"), reason: "GAL-generated security docs" },
78498
+ { path: (0, import_path52.join)(directory, ".env.example"), reason: "GAL-generated env template" }
78491
78499
  ];
78492
78500
  for (const { path: path8, reason } of setupFiles) {
78493
- if ((0, import_fs52.existsSync)(path8) && isGalCreatedFile(path8)) {
78501
+ if ((0, import_fs53.existsSync)(path8) && isGalCreatedFile(path8)) {
78494
78502
  items.push({
78495
78503
  path: path8,
78496
78504
  type: "file",
@@ -78503,12 +78511,12 @@ function detectProjectLevelItems(directory) {
78503
78511
  }
78504
78512
  function removeGalStatusLineEntry(settingsPath) {
78505
78513
  try {
78506
- const settings = JSON.parse((0, import_fs52.readFileSync)(settingsPath, "utf-8"));
78514
+ const settings = JSON.parse((0, import_fs53.readFileSync)(settingsPath, "utf-8"));
78507
78515
  if (!settings.statusLine?.command?.includes("gal-")) {
78508
78516
  return false;
78509
78517
  }
78510
78518
  delete settings.statusLine;
78511
- (0, import_fs52.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78519
+ (0, import_fs53.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78512
78520
  return true;
78513
78521
  } catch {
78514
78522
  return false;
@@ -78516,7 +78524,7 @@ function removeGalStatusLineEntry(settingsPath) {
78516
78524
  }
78517
78525
  function removeGalHookEntries(settingsPath) {
78518
78526
  try {
78519
- const settings = JSON.parse((0, import_fs52.readFileSync)(settingsPath, "utf-8"));
78527
+ const settings = JSON.parse((0, import_fs53.readFileSync)(settingsPath, "utf-8"));
78520
78528
  let modified = false;
78521
78529
  for (const hookEvent of ["SessionStart", "UserPromptSubmit"]) {
78522
78530
  if (!settings.hooks?.[hookEvent]) continue;
@@ -78539,7 +78547,7 @@ function removeGalHookEntries(settingsPath) {
78539
78547
  delete settings.hooks;
78540
78548
  }
78541
78549
  if (modified) {
78542
- (0, import_fs52.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78550
+ (0, import_fs53.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2));
78543
78551
  return true;
78544
78552
  }
78545
78553
  return false;
@@ -78549,7 +78557,7 @@ function removeGalHookEntries(settingsPath) {
78549
78557
  }
78550
78558
  function removeGalCursorHookEntries(hooksJsonPath) {
78551
78559
  try {
78552
- const hooksConfig = JSON.parse((0, import_fs52.readFileSync)(hooksJsonPath, "utf-8"));
78560
+ const hooksConfig = JSON.parse((0, import_fs53.readFileSync)(hooksJsonPath, "utf-8"));
78553
78561
  if (!hooksConfig.hooks) {
78554
78562
  return false;
78555
78563
  }
@@ -78573,7 +78581,7 @@ function removeGalCursorHookEntries(hooksJsonPath) {
78573
78581
  delete hooksConfig.hooks;
78574
78582
  }
78575
78583
  if (modified) {
78576
- (0, import_fs52.writeFileSync)(hooksJsonPath, JSON.stringify(hooksConfig, null, 2));
78584
+ (0, import_fs53.writeFileSync)(hooksJsonPath, JSON.stringify(hooksConfig, null, 2));
78577
78585
  return true;
78578
78586
  }
78579
78587
  return false;
@@ -78608,10 +78616,10 @@ function performUninstall(items, dryRun) {
78608
78616
  result.skipped.push(`${item.path} (no GAL statusLine found)`);
78609
78617
  }
78610
78618
  } else if (item.type === "directory") {
78611
- (0, import_fs52.rmSync)(item.path, { recursive: true, force: true });
78619
+ (0, import_fs53.rmSync)(item.path, { recursive: true, force: true });
78612
78620
  result.removed.push(item.path);
78613
78621
  } else {
78614
- (0, import_fs52.unlinkSync)(item.path);
78622
+ (0, import_fs53.unlinkSync)(item.path);
78615
78623
  result.removed.push(item.path);
78616
78624
  }
78617
78625
  } catch (error3) {
@@ -78707,14 +78715,14 @@ function createUninstallCommand() {
78707
78715
  });
78708
78716
  return command;
78709
78717
  }
78710
- var import_fs52, import_path51, import_os30, import_readline5;
78718
+ var import_fs53, import_path52, import_os30, import_readline5;
78711
78719
  var init_uninstall = __esm({
78712
78720
  "module_438"() {
78713
78721
  "use strict";
78714
78722
  init_esm();
78715
78723
  init_source();
78716
- import_fs52 = require("fs");
78717
- import_path51 = require("path");
78724
+ import_fs53 = require("fs");
78725
+ import_path52 = require("path");
78718
78726
  import_os30 = require("os");
78719
78727
  import_readline5 = require("readline");
78720
78728
  }
@@ -79131,27 +79139,27 @@ function compareVersions2(v1, v2) {
79131
79139
  }
79132
79140
  function acquireLock() {
79133
79141
  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 });
79142
+ const galDir = (0, import_path53.join)((0, import_os31.homedir)(), ".gal");
79143
+ if (!(0, import_fs54.existsSync)(galDir)) {
79144
+ (0, import_fs54.mkdirSync)(galDir, { recursive: true });
79137
79145
  }
79138
- if ((0, import_fs53.existsSync)(UPDATE_LOCK_FILE)) {
79146
+ if ((0, import_fs54.existsSync)(UPDATE_LOCK_FILE)) {
79139
79147
  try {
79140
- const lockContent = (0, import_fs53.readFileSync)(UPDATE_LOCK_FILE, "utf-8");
79148
+ const lockContent = (0, import_fs54.readFileSync)(UPDATE_LOCK_FILE, "utf-8");
79141
79149
  const lockTime = parseInt(lockContent, 10);
79142
79150
  if (Number.isNaN(lockTime) || Date.now() - lockTime > 5 * 60 * 1e3) {
79143
- (0, import_fs53.unlinkSync)(UPDATE_LOCK_FILE);
79151
+ (0, import_fs54.unlinkSync)(UPDATE_LOCK_FILE);
79144
79152
  } else {
79145
79153
  return false;
79146
79154
  }
79147
79155
  } catch {
79148
79156
  try {
79149
- (0, import_fs53.unlinkSync)(UPDATE_LOCK_FILE);
79157
+ (0, import_fs54.unlinkSync)(UPDATE_LOCK_FILE);
79150
79158
  } catch {
79151
79159
  }
79152
79160
  }
79153
79161
  }
79154
- (0, import_fs53.writeFileSync)(UPDATE_LOCK_FILE, String(Date.now()), { flag: "wx" });
79162
+ (0, import_fs54.writeFileSync)(UPDATE_LOCK_FILE, String(Date.now()), { flag: "wx" });
79155
79163
  return true;
79156
79164
  } catch {
79157
79165
  return false;
@@ -79159,8 +79167,8 @@ function acquireLock() {
79159
79167
  }
79160
79168
  function releaseLock() {
79161
79169
  try {
79162
- if ((0, import_fs53.existsSync)(UPDATE_LOCK_FILE)) {
79163
- (0, import_fs53.unlinkSync)(UPDATE_LOCK_FILE);
79170
+ if ((0, import_fs54.existsSync)(UPDATE_LOCK_FILE)) {
79171
+ (0, import_fs54.unlinkSync)(UPDATE_LOCK_FILE);
79164
79172
  }
79165
79173
  } catch {
79166
79174
  }
@@ -79243,8 +79251,8 @@ function createUpdateCommand() {
79243
79251
  });
79244
79252
  releaseLock();
79245
79253
  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);
79254
+ const cacheFile = (0, import_path53.join)((0, import_os31.homedir)(), ".gal", "update-cache.json");
79255
+ if ((0, import_fs54.existsSync)(cacheFile)) (0, import_fs54.unlinkSync)(cacheFile);
79248
79256
  } catch {
79249
79257
  }
79250
79258
  updateSpinner.succeed(source_default.green(`Updated to v${latestVersion}`));
@@ -79303,7 +79311,7 @@ Retry manually with: ${source_default.cyan(installCommand)}`);
79303
79311
  });
79304
79312
  return command;
79305
79313
  }
79306
- var import_https, import_child_process18, import_fs53, import_path52, import_os31, UPDATE_LOCK_FILE, cliVersion8, REGISTRY_URL;
79314
+ var import_https, import_child_process18, import_fs54, import_path53, import_os31, UPDATE_LOCK_FILE, cliVersion8, REGISTRY_URL;
79307
79315
  var init_update = __esm({
79308
79316
  "module_440"() {
79309
79317
  "use strict";
@@ -79312,14 +79320,14 @@ var init_update = __esm({
79312
79320
  init_ora();
79313
79321
  import_https = __toESM(require("https"), 1);
79314
79322
  import_child_process18 = require("child_process");
79315
- import_fs53 = require("fs");
79316
- import_path52 = require("path");
79323
+ import_fs54 = require("fs");
79324
+ import_path53 = require("path");
79317
79325
  import_os31 = require("os");
79318
79326
  init_constants();
79319
79327
  init_path_conflict();
79320
79328
  init_install();
79321
79329
  init_telemetry();
79322
- UPDATE_LOCK_FILE = (0, import_path52.join)((0, import_os31.homedir)(), ".gal", "update.lock");
79330
+ UPDATE_LOCK_FILE = (0, import_path53.join)((0, import_os31.homedir)(), ".gal", "update.lock");
79323
79331
  cliVersion8 = constants_default[0];
79324
79332
  REGISTRY_URL = getRegistryUrl();
79325
79333
  }
@@ -79825,9 +79833,9 @@ function createWorkflowCommand() {
79825
79833
  const apiUrl = process.env.GAL_API_URL || defaultApiUrl20;
79826
79834
  try {
79827
79835
  const spinner = ora(`Reading ${filePath}...`).start();
79828
- const absolutePath = import_path53.default.resolve(filePath);
79836
+ const absolutePath = import_path54.default.resolve(filePath);
79829
79837
  const content = await import_promises14.default.readFile(absolutePath, "utf-8");
79830
- const fileName = import_path53.default.basename(filePath);
79838
+ const fileName = import_path54.default.basename(filePath);
79831
79839
  let type = options.type;
79832
79840
  if (!type) {
79833
79841
  if (fileName.endsWith(".md")) {
@@ -79883,7 +79891,7 @@ function createWorkflowCommand() {
79883
79891
  spinner.fail(source_default.red("No organization found. Please connect GitHub via dashboard or use --org flag"));
79884
79892
  process.exit(1);
79885
79893
  }
79886
- const dirPath = import_path53.default.resolve(directory);
79894
+ const dirPath = import_path54.default.resolve(directory);
79887
79895
  const files = await import_promises14.default.readdir(dirPath);
79888
79896
  const workflowFiles = files.filter(
79889
79897
  (f) => f.endsWith(".md") || f.includes("hook") && (f.endsWith(".json") || f.endsWith(".py") || f.endsWith(".js"))
@@ -79895,7 +79903,7 @@ function createWorkflowCommand() {
79895
79903
  spinner.text = `Found ${workflowFiles.length} workflow files. Preparing batch test...`;
79896
79904
  const requests = [];
79897
79905
  for (const file of workflowFiles) {
79898
- const filePath = import_path53.default.join(dirPath, file);
79906
+ const filePath = import_path54.default.join(dirPath, file);
79899
79907
  const content = await import_promises14.default.readFile(filePath, "utf-8");
79900
79908
  const type = file.endsWith(".md") ? "command" : "hook";
79901
79909
  requests.push({
@@ -79993,7 +80001,7 @@ function displayTestResult(result) {
79993
80001
  }
79994
80002
  console.log();
79995
80003
  }
79996
- var import_promises14, import_path53, defaultApiUrl20;
80004
+ var import_promises14, import_path54, defaultApiUrl20;
79997
80005
  var init_workflow2 = __esm({
79998
80006
  "module_442"() {
79999
80007
  "use strict";
@@ -80001,7 +80009,7 @@ var init_workflow2 = __esm({
80001
80009
  init_source();
80002
80010
  init_ora();
80003
80011
  import_promises14 = __toESM(require("fs/promises"), 1);
80004
- import_path53 = __toESM(require("path"), 1);
80012
+ import_path54 = __toESM(require("path"), 1);
80005
80013
  init_constants();
80006
80014
  init_client();
80007
80015
  defaultApiUrl20 = constants_default[1];
@@ -80362,11 +80370,11 @@ function getRegistryAuthToken2() {
80362
80370
  return void 0;
80363
80371
  }
80364
80372
  try {
80365
- const npmrcPath = (0, import_path54.join)((0, import_os32.homedir)(), ".npmrc");
80366
- if (!(0, import_fs54.existsSync)(npmrcPath)) {
80373
+ const npmrcPath = (0, import_path55.join)((0, import_os32.homedir)(), ".npmrc");
80374
+ if (!(0, import_fs55.existsSync)(npmrcPath)) {
80367
80375
  return void 0;
80368
80376
  }
80369
- const npmrc = (0, import_fs54.readFileSync)(npmrcPath, "utf-8");
80377
+ const npmrc = (0, import_fs55.readFileSync)(npmrcPath, "utf-8");
80370
80378
  const escapedHost = REGISTRY_HOST.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
80371
80379
  const match = npmrc.match(
80372
80380
  new RegExp(`^//${escapedHost}/:_authToken=(.+)$`, "m")
@@ -80386,8 +80394,8 @@ function getRegistryAuthToken2() {
80386
80394
  }
80387
80395
  function readUpdateCache() {
80388
80396
  try {
80389
- if ((0, import_fs54.existsSync)(UPDATE_CACHE_FILE)) {
80390
- return JSON.parse((0, import_fs54.readFileSync)(UPDATE_CACHE_FILE, "utf-8"));
80397
+ if ((0, import_fs55.existsSync)(UPDATE_CACHE_FILE)) {
80398
+ return JSON.parse((0, import_fs55.readFileSync)(UPDATE_CACHE_FILE, "utf-8"));
80391
80399
  }
80392
80400
  } catch {
80393
80401
  }
@@ -80395,10 +80403,10 @@ function readUpdateCache() {
80395
80403
  }
80396
80404
  function writeUpdateCache(cache) {
80397
80405
  try {
80398
- if (!(0, import_fs54.existsSync)(UPDATE_CACHE_DIR)) {
80399
- (0, import_fs54.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80406
+ if (!(0, import_fs55.existsSync)(UPDATE_CACHE_DIR)) {
80407
+ (0, import_fs55.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80400
80408
  }
80401
- (0, import_fs54.writeFileSync)(UPDATE_CACHE_FILE, JSON.stringify(cache));
80409
+ (0, import_fs55.writeFileSync)(UPDATE_CACHE_FILE, JSON.stringify(cache));
80402
80410
  } catch {
80403
80411
  }
80404
80412
  }
@@ -80538,8 +80546,8 @@ async function checkForUpdates() {
80538
80546
  });
80539
80547
  if (!isUpdateCommand && !isCI && !isAutoUpdateDisabled) {
80540
80548
  try {
80541
- const lockFile = (0, import_path54.join)((0, import_os32.homedir)(), ".gal", "update.lock");
80542
- if (!(0, import_fs54.existsSync)(lockFile)) {
80549
+ const lockFile = (0, import_path55.join)((0, import_os32.homedir)(), ".gal", "update.lock");
80550
+ if (!(0, import_fs55.existsSync)(lockFile)) {
80543
80551
  const child = (0, import_child_process19.spawn)("gal", ["update"], {
80544
80552
  detached: true,
80545
80553
  stdio: "ignore",
@@ -80588,9 +80596,9 @@ async function checkForUpdates() {
80588
80596
  function checkPathConflicts() {
80589
80597
  try {
80590
80598
  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"));
80599
+ const CONFLICT_CACHE = (0, import_path55.join)(UPDATE_CACHE_DIR, "path-conflict-cache.json");
80600
+ if ((0, import_fs55.existsSync)(CONFLICT_CACHE)) {
80601
+ const cached2 = JSON.parse((0, import_fs55.readFileSync)(CONFLICT_CACHE, "utf-8"));
80594
80602
  if (Date.now() - (cached2.lastCheck || 0) < ONE_DAY) {
80595
80603
  if (cached2.hasConflict) {
80596
80604
  process.on("exit", () => {
@@ -80604,10 +80612,10 @@ function checkPathConflicts() {
80604
80612
  const conflict = detectPathConflict(cliVersion10);
80605
80613
  const cacheData = { lastCheck: Date.now(), hasConflict: !!conflict };
80606
80614
  try {
80607
- if (!(0, import_fs54.existsSync)(UPDATE_CACHE_DIR)) {
80608
- (0, import_fs54.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80615
+ if (!(0, import_fs55.existsSync)(UPDATE_CACHE_DIR)) {
80616
+ (0, import_fs55.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80609
80617
  }
80610
- (0, import_fs54.writeFileSync)(CONFLICT_CACHE, JSON.stringify(cacheData));
80618
+ (0, import_fs55.writeFileSync)(CONFLICT_CACHE, JSON.stringify(cacheData));
80611
80619
  } catch {
80612
80620
  }
80613
80621
  if (conflict) {
@@ -80620,9 +80628,9 @@ function checkPathConflicts() {
80620
80628
  }
80621
80629
  function refreshOrgMemberships() {
80622
80630
  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"));
80631
+ const configPath = (0, import_path55.join)((0, import_os32.homedir)(), ".gal", "config.json");
80632
+ if (!(0, import_fs55.existsSync)(configPath)) return;
80633
+ const config2 = JSON.parse((0, import_fs55.readFileSync)(configPath, "utf-8"));
80626
80634
  if (!config2.authToken) return;
80627
80635
  const checkedAt = config2.orgMembershipsCheckedAt || 0;
80628
80636
  if (Date.now() - checkedAt < ONE_DAY) return;
@@ -80654,10 +80662,10 @@ function refreshOrgMemberships() {
80654
80662
  config2.capabilities = user.capabilities;
80655
80663
  config2.capabilitiesCachedAt = Date.now();
80656
80664
  }
80657
- if (!(0, import_fs54.existsSync)(UPDATE_CACHE_DIR)) {
80658
- (0, import_fs54.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80665
+ if (!(0, import_fs55.existsSync)(UPDATE_CACHE_DIR)) {
80666
+ (0, import_fs55.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
80659
80667
  }
80660
- (0, import_fs54.writeFileSync)(configPath, JSON.stringify(config2, null, 2));
80668
+ (0, import_fs55.writeFileSync)(configPath, JSON.stringify(config2, null, 2));
80661
80669
  }
80662
80670
  } catch {
80663
80671
  }
@@ -80684,11 +80692,11 @@ function refreshOrgMemberships() {
80684
80692
  if (res.statusCode !== 200) return;
80685
80693
  const flags = JSON.parse(data);
80686
80694
  if (flags.orgAudienceTierMap) {
80687
- const freshConfig = JSON.parse((0, import_fs54.readFileSync)(configPath, "utf-8"));
80695
+ const freshConfig = JSON.parse((0, import_fs55.readFileSync)(configPath, "utf-8"));
80688
80696
  freshConfig.orgAudienceTierMap = flags.orgAudienceTierMap;
80689
80697
  freshConfig.orgPlanMap = flags.orgPlanMap || freshConfig.orgPlanMap || {};
80690
80698
  freshConfig.flagsCachedAt = Date.now();
80691
- (0, import_fs54.writeFileSync)(configPath, JSON.stringify(freshConfig, null, 2));
80699
+ (0, import_fs55.writeFileSync)(configPath, JSON.stringify(freshConfig, null, 2));
80692
80700
  }
80693
80701
  } catch {
80694
80702
  }
@@ -80718,7 +80726,7 @@ function getRequestedCommand(argv) {
80718
80726
  }
80719
80727
  return null;
80720
80728
  }
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;
80729
+ 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
80730
  var init_index = __esm({
80723
80731
  "module_446"() {
80724
80732
  "use strict";
@@ -80727,8 +80735,8 @@ var init_index = __esm({
80727
80735
  import_https2 = __toESM(require("https"), 1);
80728
80736
  import_readline6 = __toESM(require("readline"), 1);
80729
80737
  import_child_process19 = require("child_process");
80730
- import_fs54 = require("fs");
80731
- import_path54 = require("path");
80738
+ import_fs55 = require("fs");
80739
+ import_path55 = require("path");
80732
80740
  import_os32 = require("os");
80733
80741
  init_source();
80734
80742
  init_constants();
@@ -80778,8 +80786,8 @@ var init_index = __esm({
80778
80786
  process.once("unhandledRejection", (error3) => {
80779
80787
  handleFatalCliError(error3);
80780
80788
  });
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");
80789
+ UPDATE_CACHE_DIR = (0, import_path55.join)((0, import_os32.homedir)(), ".gal");
80790
+ UPDATE_CACHE_FILE = (0, import_path55.join)(UPDATE_CACHE_DIR, "update-cache.json");
80783
80791
  ONE_DAY = 24 * 60 * 60 * 1e3;
80784
80792
  REGISTRY_URL2 = (() => {
80785
80793
  const raw = process.env.GAL_REGISTRY_URL || "https://registry.npmjs.org";
@@ -80935,7 +80943,7 @@ var init_index = __esm({
80935
80943
  }
80936
80944
  });
80937
80945
 
80938
- var cliVersion11 = true ? "0.0.564" : "0.0.0-dev";
80946
+ var cliVersion11 = true ? "0.0.565" : "0.0.0-dev";
80939
80947
  var args = process.argv.slice(2);
80940
80948
  var requestedGlobalHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
80941
80949
  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.565",
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,