@scheduler-systems/gal-run 0.0.310 → 0.0.312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +73 -30
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -3970,7 +3970,7 @@ var cliVersion, defaultApiUrl, BUILD_CONSTANTS, constants_default;
3970
3970
  var init_constants = __esm({
3971
3971
  "src/constants.ts"() {
3972
3972
  "use strict";
3973
- cliVersion = true ? "0.0.310" : "0.0.0-dev";
3973
+ cliVersion = true ? "0.0.312" : "0.0.0-dev";
3974
3974
  defaultApiUrl = true ? "https://api.gal.run" : "http://localhost:3000";
3975
3975
  BUILD_CONSTANTS = Object.freeze([cliVersion, defaultApiUrl]);
3976
3976
  constants_default = BUILD_CONSTANTS;
@@ -4880,7 +4880,7 @@ function detectEnvironment() {
4880
4880
  return "dev";
4881
4881
  }
4882
4882
  try {
4883
- const version = true ? "0.0.310" : void 0;
4883
+ const version = true ? "0.0.312" : void 0;
4884
4884
  if (version && version.includes("-local")) {
4885
4885
  return "dev";
4886
4886
  }
@@ -5249,7 +5249,7 @@ function getId() {
5249
5249
  }
5250
5250
  function getCliVersion() {
5251
5251
  try {
5252
- return true ? "0.0.310" : "0.0.0-dev";
5252
+ return true ? "0.0.312" : "0.0.0-dev";
5253
5253
  } catch {
5254
5254
  return "0.0.0-dev";
5255
5255
  }
@@ -31158,13 +31158,37 @@ gal sync --pull --auto 2>/dev/null || true
31158
31158
  }
31159
31159
  }
31160
31160
  function installGeminiHooks() {
31161
- const geminiHooksDir = (0, import_path14.join)((0, import_os14.homedir)(), ".gemini", "hooks");
31162
- const hookPath = (0, import_path14.join)(geminiHooksDir, "gal-sync.sh");
31161
+ const geminiExtensionsDir = (0, import_path14.join)((0, import_os14.homedir)(), ".gemini", "extensions");
31162
+ const extensionName = "gal-sync";
31163
+ const extensionSourceDir = (0, import_path14.join)((0, import_os14.homedir)(), ".gal", "gemini-extension");
31164
+ const extensionInstallDir = (0, import_path14.join)(geminiExtensionsDir, extensionName);
31165
+ const enablementPath = (0, import_path14.join)(geminiExtensionsDir, "extension-enablement.json");
31166
+ const manifestPath = (0, import_path14.join)(extensionSourceDir, "gemini-extension.json");
31167
+ const scriptPath = (0, import_path14.join)(extensionSourceDir, "scripts", "gal-sync.sh");
31163
31168
  try {
31164
- if (!(0, import_fs15.existsSync)(geminiHooksDir)) {
31165
- (0, import_fs15.mkdirSync)(geminiHooksDir, { recursive: true });
31169
+ if ((0, import_fs15.existsSync)(manifestPath)) {
31170
+ try {
31171
+ const manifest = JSON.parse((0, import_fs15.readFileSync)(manifestPath, "utf-8"));
31172
+ if (manifest.version === "2.2.0") {
31173
+ return { agent: "gemini", status: "up_to_date", path: extensionSourceDir };
31174
+ }
31175
+ } catch {
31176
+ }
31166
31177
  }
31167
- const hookContent = `#!/bin/sh
31178
+ (0, import_fs15.mkdirSync)((0, import_path14.join)(extensionSourceDir, "hooks"), { recursive: true });
31179
+ (0, import_fs15.mkdirSync)((0, import_path14.join)(extensionSourceDir, "scripts"), { recursive: true });
31180
+ (0, import_fs15.writeFileSync)(manifestPath, JSON.stringify({ name: extensionName, version: "2.2.0" }, null, 2), "utf-8");
31181
+ (0, import_fs15.writeFileSync)((0, import_path14.join)(extensionSourceDir, "hooks", "hooks.json"), JSON.stringify({
31182
+ hooks: {
31183
+ SessionStart: [{
31184
+ hooks: [{
31185
+ type: "command",
31186
+ command: 'sh "${extensionPath}/scripts/gal-sync.sh"'
31187
+ }]
31188
+ }]
31189
+ }
31190
+ }, null, 2), "utf-8");
31191
+ const scriptContent = `#!/bin/sh
31168
31192
  # GAL Config Sync Hook for Gemini CLI
31169
31193
  # Installed by: gal hooks install
31170
31194
  # GAL_HOOK_VERSION = "2.2.0"
@@ -31189,23 +31213,24 @@ nohup sh -c "gal update --check 2>/dev/null" >/dev/null 2>&1 &
31189
31213
  # Config sync
31190
31214
  gal sync --pull --auto 2>/dev/null || true
31191
31215
  `;
31192
- if ((0, import_fs15.existsSync)(hookPath)) {
31193
- const existing = (0, import_fs15.readFileSync)(hookPath, "utf-8");
31194
- if (existing.includes('GAL_HOOK_VERSION = "2.2.0"')) {
31195
- return {
31196
- agent: "gemini",
31197
- status: "up_to_date",
31198
- path: hookPath
31199
- };
31216
+ (0, import_fs15.writeFileSync)(scriptPath, scriptContent, "utf-8");
31217
+ (0, import_fs15.chmodSync)(scriptPath, "755");
31218
+ (0, import_fs15.mkdirSync)(extensionInstallDir, { recursive: true });
31219
+ (0, import_fs15.writeFileSync)(
31220
+ (0, import_path14.join)(extensionInstallDir, ".gemini-extension-install.json"),
31221
+ JSON.stringify({ source: extensionSourceDir, type: "link" }, null, 2),
31222
+ "utf-8"
31223
+ );
31224
+ let enablement = {};
31225
+ if ((0, import_fs15.existsSync)(enablementPath)) {
31226
+ try {
31227
+ enablement = JSON.parse((0, import_fs15.readFileSync)(enablementPath, "utf-8"));
31228
+ } catch {
31200
31229
  }
31201
31230
  }
31202
- (0, import_fs15.writeFileSync)(hookPath, hookContent, "utf-8");
31203
- (0, import_fs15.chmodSync)(hookPath, "755");
31204
- return {
31205
- agent: "gemini",
31206
- status: "installed",
31207
- path: hookPath
31208
- };
31231
+ enablement[extensionName] = { overrides: [`${(0, import_os14.homedir)()}/*`] };
31232
+ (0, import_fs15.writeFileSync)(enablementPath, JSON.stringify(enablement, null, 2), "utf-8");
31233
+ return { agent: "gemini", status: "installed", path: extensionSourceDir };
31209
31234
  } catch (error2) {
31210
31235
  return {
31211
31236
  agent: "gemini",
@@ -31762,9 +31787,27 @@ function uninstallHooks() {
31762
31787
  errors.push(`Failed to remove Windsurf hooks: ${error2 instanceof Error ? error2.message : String(error2)}`);
31763
31788
  }
31764
31789
  try {
31765
- const geminiHookPath = (0, import_path14.join)((0, import_os14.homedir)(), ".gemini", "hooks", "gal-sync.sh");
31766
- if ((0, import_fs15.existsSync)(geminiHookPath)) {
31767
- (0, import_fs15.unlinkSync)(geminiHookPath);
31790
+ const geminiExtensionsDir = (0, import_path14.join)((0, import_os14.homedir)(), ".gemini", "extensions");
31791
+ const extensionInstallDir = (0, import_path14.join)(geminiExtensionsDir, "gal-sync");
31792
+ const enablementPath = (0, import_path14.join)(geminiExtensionsDir, "extension-enablement.json");
31793
+ if ((0, import_fs15.existsSync)(extensionInstallDir)) {
31794
+ (0, import_fs15.rmSync)(extensionInstallDir, { recursive: true, force: true });
31795
+ hookRemoved = true;
31796
+ }
31797
+ if ((0, import_fs15.existsSync)(enablementPath)) {
31798
+ try {
31799
+ const enablement = JSON.parse((0, import_fs15.readFileSync)(enablementPath, "utf-8"));
31800
+ if ("gal-sync" in enablement) {
31801
+ delete enablement["gal-sync"];
31802
+ (0, import_fs15.writeFileSync)(enablementPath, JSON.stringify(enablement, null, 2), "utf-8");
31803
+ hookRemoved = true;
31804
+ }
31805
+ } catch {
31806
+ }
31807
+ }
31808
+ const legacyHookPath = (0, import_path14.join)((0, import_os14.homedir)(), ".gemini", "hooks", "gal-sync.sh");
31809
+ if ((0, import_fs15.existsSync)(legacyHookPath)) {
31810
+ (0, import_fs15.unlinkSync)(legacyHookPath);
31768
31811
  hookRemoved = true;
31769
31812
  }
31770
31813
  } catch (error2) {
@@ -31889,10 +31932,10 @@ function createHooksCommand() {
31889
31932
  multiPlatformStatus.push({ agent: "Windsurf", detected: true, installed: windsurfInstalled, pending: false, path: windsurfHooksPath });
31890
31933
  }
31891
31934
  const geminiDetected = isAgentInstalled("gemini");
31892
- const geminiHookPath = (0, import_path14.join)((0, import_os14.homedir)(), ".gemini", "hooks", "gal-sync.sh");
31893
- const geminiInstalled = geminiDetected && (0, import_fs15.existsSync)(geminiHookPath);
31935
+ const geminiExtensionDir = (0, import_path14.join)((0, import_os14.homedir)(), ".gal", "gemini-extension");
31936
+ const geminiInstalled = geminiDetected && (0, import_fs15.existsSync)((0, import_path14.join)(geminiExtensionDir, "gemini-extension.json"));
31894
31937
  if (geminiDetected) {
31895
- multiPlatformStatus.push({ agent: "Gemini", detected: true, installed: geminiInstalled, pending: false, path: geminiHookPath });
31938
+ multiPlatformStatus.push({ agent: "Gemini", detected: true, installed: geminiInstalled, pending: false, path: geminiExtensionDir });
31896
31939
  }
31897
31940
  const ampDetected = isAgentInstalled("amp");
31898
31941
  if (ampDetected) {
@@ -54876,7 +54919,7 @@ var init_index = __esm({
54876
54919
  });
54877
54920
 
54878
54921
  // src/bootstrap.ts
54879
- var cliVersion10 = true ? "0.0.310" : "0.0.0-dev";
54922
+ var cliVersion10 = true ? "0.0.312" : "0.0.0-dev";
54880
54923
  var args = process.argv.slice(2);
54881
54924
  var requestedGlobalHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
54882
54925
  var requestedVersion = args.length === 1 && (args[0] === "--version" || args[0] === "-V");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scheduler-systems/gal-run",
3
- "version": "0.0.310",
3
+ "version": "0.0.312",
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,