@a5c-ai/babysitter-github 5.0.1-staging.92b6f9ae → 5.0.1-staging.954846d7

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.
@@ -13,7 +13,7 @@ function getUserHome() {
13
13
  }
14
14
 
15
15
  function getHarnessHome() {
16
- return path.join(os.homedir(), '.copilot');
16
+ return path.join(os.homedir(), ".copilot");
17
17
  }
18
18
 
19
19
  function getHomePluginRoot(scope) {
@@ -454,8 +454,9 @@ function installManagedHooks(packageRoot, copilotHome) {
454
454
  mergeManagedHooksConfig(packageRoot, copilotHome);
455
455
  }
456
456
 
457
- function removeLegacyHooks(copilotHome) {
458
- for (const hookName of LEGACY_HOOK_SCRIPT_NAMES) {
457
+ function removeManagedHooks(copilotHome) {
458
+ const managedHookNames = [...LEGACY_HOOK_SCRIPT_NAMES, ...HOOK_SCRIPT_NAMES];
459
+ for (const hookName of managedHookNames) {
459
460
  fs.rmSync(path.join(copilotHome, 'hooks', hookName), { force: true });
460
461
  }
461
462
 
@@ -476,10 +477,17 @@ function removeLegacyHooks(copilotHome) {
476
477
  const eventHooks = Array.isArray(hooksConfig.hooks[eventName]) ? hooksConfig.hooks[eventName] : [];
477
478
  const filteredMatchers = eventHooks
478
479
  .map((matcher) => {
480
+ const directBash = String(matcher?.bash || matcher?.command || '');
481
+ const directPs = String(matcher?.powershell || '');
482
+ const hasDirectHook = directBash.length > 0 || directPs.length > 0;
483
+ const directIsManaged = managedHookNames.some((name) => directBash.includes(name) || directPs.includes(name));
484
+ if (hasDirectHook) {
485
+ return directIsManaged ? null : matcher;
486
+ }
479
487
  const hooks = Array.isArray(matcher.hooks) ? matcher.hooks : [];
480
488
  const keptHooks = hooks.filter((hook) => {
481
489
  const command = String(hook.command || '');
482
- return !LEGACY_HOOK_SCRIPT_NAMES.some((name) => command.includes(name));
490
+ return !managedHookNames.some((name) => command.includes(name));
483
491
  });
484
492
  return keptHooks.length > 0 ? { ...matcher, hooks: keptHooks } : null;
485
493
  })
@@ -498,11 +506,13 @@ function removeLegacyHooks(copilotHome) {
498
506
  }
499
507
 
500
508
  function installCopilotSurface(packageRoot, copilotHome) {
501
- removeLegacyHooks(copilotHome);
509
+ removeManagedHooks(copilotHome);
502
510
  installManagedSkills(packageRoot, copilotHome);
503
511
  installManagedHooks(packageRoot, copilotHome);
504
512
  }
505
513
 
514
+ const removeLegacyHooks = removeManagedHooks;
515
+
506
516
  function renderCloudAgentAgentsBlock() {
507
517
  return [
508
518
  '## Babysitter Cloud Agent',
@@ -831,10 +841,19 @@ module.exports = {
831
841
  resolveCliCommand,
832
842
  runCli,
833
843
  ensureGlobalProcessLibrary,
844
+ PLUGIN_BUNDLE_ENTRIES,
845
+ copyRecursive,
846
+ copyPluginBundle,
847
+ DEFAULT_MARKETPLACE,
848
+ normalizeMarketplaceSourcePath,
849
+ ensureMarketplaceEntry,
850
+ removeMarketplaceEntry,
851
+ installManagedSkills,
852
+ mergeManagedHooksConfig,
853
+ installManagedHooks,
854
+ warnWindowsHooks,
834
855
  LEGACY_HOOK_SCRIPT_NAMES,
835
856
  HOOK_SCRIPT_NAMES,
836
- DEFAULT_MARKETPLACE,
837
- PLUGIN_BUNDLE_ENTRIES,
838
857
  CLOUD_AGENT_BUNDLE_ENTRIES,
839
858
  MANAGED_BLOCK_START,
840
859
  MANAGED_BLOCK_END,
@@ -849,10 +868,8 @@ module.exports = {
849
868
  rewriteCloudSkill,
850
869
  registerCopilotPlugin,
851
870
  deregisterCopilotPlugin,
852
- installManagedSkills,
853
- mergeManagedHooksConfig,
854
- installManagedHooks,
855
871
  removeLegacyHooks,
872
+ removeManagedHooks,
856
873
  installCopilotSurface,
857
874
  renderCloudAgentAgentsBlock,
858
875
  renderCloudAgentCopilotInstructionsBlock,
@@ -862,12 +879,6 @@ module.exports = {
862
879
  installCloudAgentInstructions,
863
880
  installCloudAgentSetupSteps,
864
881
  installCloudAgentSurface,
865
- normalizeMarketplaceSourcePath,
866
- ensureMarketplaceEntry,
867
- removeMarketplaceEntry,
868
- warnWindowsHooks,
869
- copyPluginBundle,
870
- copyRecursive,
871
882
  harnessCliRoute,
872
883
  harnessInstall,
873
884
  };
package/bin/install.js CHANGED
@@ -65,6 +65,15 @@ function main() {
65
65
  try {
66
66
  shared.copyPluginBundle(PACKAGE_ROOT, pluginRoot);
67
67
  shared.ensureMarketplaceEntry(marketplacePath, pluginRoot);
68
+ if (typeof shared.registerCopilotPlugin === 'function') {
69
+ shared.registerCopilotPlugin(pluginRoot);
70
+ }
71
+ if (typeof shared.installCopilotSurface === 'function' && typeof shared.getCopilotHome === 'function') {
72
+ shared.installCopilotSurface(PACKAGE_ROOT, shared.getCopilotHome());
73
+ }
74
+ if (typeof shared.warnWindowsHooks === 'function') {
75
+ shared.warnWindowsHooks();
76
+ }
68
77
  if (typeof shared.harnessInstall === 'function') {
69
78
  shared.harnessInstall(PACKAGE_ROOT, pluginRoot);
70
79
  }
package/bin/uninstall.js CHANGED
@@ -7,17 +7,38 @@ const shared = require('./install-shared');
7
7
 
8
8
  function main() {
9
9
  const pluginRoot = shared.getHomePluginRoot();
10
+ const marketplacePath = typeof shared.getHomeMarketplacePath === 'function'
11
+ ? shared.getHomeMarketplacePath()
12
+ : null;
13
+ const copilotHome = typeof shared.getCopilotHome === 'function'
14
+ ? shared.getCopilotHome()
15
+ : null;
10
16
 
11
17
  if (!fs.existsSync(pluginRoot)) {
12
18
  console.log(`[${shared.PLUGIN_NAME}] Plugin not installed at ${pluginRoot}`);
13
- return;
19
+ } else {
20
+ try {
21
+ fs.rmSync(pluginRoot, { recursive: true, force: true });
22
+ console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
23
+ } catch (err) {
24
+ console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
25
+ process.exitCode = 1;
26
+ return;
27
+ }
14
28
  }
15
29
 
16
30
  try {
17
- fs.rmSync(pluginRoot, { recursive: true, force: true });
18
- console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
31
+ if (typeof shared.deregisterCopilotPlugin === 'function') {
32
+ shared.deregisterCopilotPlugin(pluginRoot);
33
+ }
34
+ if (copilotHome && typeof shared.removeManagedHooks === 'function') {
35
+ shared.removeManagedHooks(copilotHome);
36
+ }
37
+ if (marketplacePath && typeof shared.removeMarketplaceEntry === 'function') {
38
+ shared.removeMarketplaceEntry(marketplacePath);
39
+ }
19
40
  } catch (err) {
20
- console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
41
+ console.error(`[${shared.PLUGIN_NAME}] Failed to clean up uninstall state: ${err.message}`);
21
42
  process.exitCode = 1;
22
43
  }
23
44
  }
package/package.json CHANGED
@@ -1,28 +1,26 @@
1
1
  {
2
2
  "name": "@a5c-ai/babysitter-github",
3
- "version": "5.0.1-staging.92b6f9ae",
3
+ "version": "5.0.1-staging.954846d7",
4
4
  "description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
5
5
  "scripts": {
6
6
  "deploy": "npm publish --access public",
7
7
  "deploy:staging": "npm publish --access public --tag staging",
8
- "postinstall": "node bin/install.js",
9
- "preuninstall": "node bin/uninstall.js",
10
- "team:install": "node scripts/team-install.js",
11
- "test": "node scripts/sync-command-surfaces.js --check",
12
- "sync:commands": "node scripts/sync-command-surfaces.js"
8
+ "plugin:install": "node bin/install.js --global",
9
+ "plugin:uninstall": "node bin/uninstall.js --global",
10
+ "team:install": "node scripts/team-install.js"
13
11
  },
14
12
  "bin": {
15
- "babysitter-github-copilot": "bin/cli.js"
13
+ "babysitter-github": "bin/cli.js"
16
14
  },
17
15
  "files": [
18
16
  "bin/",
19
17
  "hooks.json",
18
+ "AGENTS.md",
20
19
  "hooks/",
21
20
  "skills/",
22
21
  "commands/",
23
22
  "scripts/",
24
23
  "plugin.json",
25
- "AGENTS.md",
26
24
  "README.md",
27
25
  "versions.json",
28
26
  "package.json"
@@ -38,11 +36,15 @@
38
36
  "access": "public"
39
37
  },
40
38
  "dependencies": {
41
- "@a5c-ai/babysitter-sdk": "5.0.1-staging.92b6f9ae"
39
+ "@a5c-ai/babysitter-sdk": "5.0.1-staging.954846d7"
42
40
  },
43
41
  "repository": {
44
42
  "type": "git",
45
- "url": "https://github.com/a5c-ai/babysitter"
43
+ "url": "git+https://github.com/a5c-ai/babysitter.git",
44
+ "directory": "plugins/babysitter-github"
46
45
  },
47
- "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-github#readme"
46
+ "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-github#readme",
47
+ "bugs": {
48
+ "url": "https://github.com/a5c-ai/babysitter/issues"
49
+ }
48
50
  }
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babysitter",
3
- "version": "5.0.1-staging.92b6f9ae",
3
+ "version": "5.0.1-staging.954846d7",
4
4
  "description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
5
5
  "author": {
6
6
  "name": "a5c.ai"
@@ -1,62 +1,20 @@
1
+ #!/usr/bin/env node
1
2
  'use strict';
2
3
 
3
4
  const path = require('path');
4
- const {
5
- listDirectories,
6
- listMarkdownBasenames,
7
- reportCheckResult,
8
- syncCommandMirrors,
9
- syncSkillsFromCommands,
10
- } = require('../../../scripts/plugin-command-sync-lib.cjs');
5
+ const { spawnSync } = require('child_process');
11
6
 
12
- const PACKAGE_ROOT = path.resolve(__dirname, '..');
13
- const REPO_ROOT = path.resolve(PACKAGE_ROOT, '..', '..');
14
- const ROOT_COMMANDS = path.join(REPO_ROOT, 'plugins', 'babysitter', 'commands');
15
- const PLUGIN_COMMANDS = path.join(PACKAGE_ROOT, 'commands');
16
- const PLUGIN_SKILLS = path.join(PACKAGE_ROOT, 'skills');
17
- const LABEL = 'babysitter-github sync';
7
+ const REPO_ROOT = path.resolve(__dirname, '..', '..');
8
+ const syncScript = path.join(REPO_ROOT, 'scripts', 'sync-plugin-commands.cjs');
9
+ const args = [syncScript, '--target', 'github-copilot'];
18
10
 
19
- function getMirroredCommandNames() {
20
- const local = new Set(listMarkdownBasenames(PLUGIN_COMMANDS));
21
- return listMarkdownBasenames(ROOT_COMMANDS).filter((name) => local.has(name));
11
+ if (process.argv.includes('--check')) {
12
+ args.push('--check');
22
13
  }
23
14
 
24
- function getDerivedSkillNames() {
25
- const local = new Set(listDirectories(PLUGIN_SKILLS));
26
- return listMarkdownBasenames(PLUGIN_COMMANDS).filter((name) => local.has(name));
27
- }
28
-
29
- function main() {
30
- const check = process.argv.includes('--check');
31
- const mirrorResult = syncCommandMirrors({
32
- label: LABEL,
33
- sourceRoot: ROOT_COMMANDS,
34
- targetRoot: PLUGIN_COMMANDS,
35
- names: getMirroredCommandNames(),
36
- check,
37
- cwd: PACKAGE_ROOT,
38
- });
39
- const skillsResult = syncSkillsFromCommands({
40
- label: LABEL,
41
- sourceRoot: PLUGIN_COMMANDS,
42
- skillsRoot: PLUGIN_SKILLS,
43
- names: getDerivedSkillNames(),
44
- check,
45
- cwd: PACKAGE_ROOT,
46
- });
47
-
48
- if (check) {
49
- reportCheckResult(LABEL, [...mirrorResult.stale, ...skillsResult.stale]);
50
- return;
51
- }
52
-
53
- const updated = mirrorResult.updated + skillsResult.updated;
54
- if (updated === 0) {
55
- console.log(`[${LABEL}] no GitHub plugin command changes were needed.`);
56
- return;
57
- }
58
-
59
- console.log(`[${LABEL}] updated ${updated} GitHub plugin file(s).`);
60
- }
15
+ const result = spawnSync(process.execPath, args, {
16
+ cwd: REPO_ROOT,
17
+ stdio: 'inherit',
18
+ });
61
19
 
62
- main();
20
+ process.exit(result.status ?? 1);
package/versions.json CHANGED
@@ -1,3 +1,4 @@
1
1
  {
2
- "sdkVersion": "5.0.1-staging.92b6f9ae"
2
+ "sdkVersion": "5.0.1-staging.954846d7",
3
+ "extensionVersion": "5.0.0"
3
4
  }