@a5c-ai/babysitter-github 5.0.1-staging.c66885f8 → 5.0.1-staging.c758d5da

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 (39) hide show
  1. package/bin/cli.js +14 -26
  2. package/bin/install-shared.js +398 -215
  3. package/bin/install.js +49 -89
  4. package/bin/uninstall.js +30 -60
  5. package/commands/doctor.md +5 -5
  6. package/commands/help.md +245 -244
  7. package/commands/observe.md +12 -12
  8. package/hooks/babysitter-proxied-session-end.ps1 +10 -114
  9. package/hooks/babysitter-proxied-session-end.sh +2 -111
  10. package/hooks/babysitter-proxied-session-start.ps1 +10 -187
  11. package/hooks/babysitter-proxied-session-start.sh +6 -168
  12. package/hooks/babysitter-proxied-user-prompt-submitted.ps1 +10 -90
  13. package/hooks/babysitter-proxied-user-prompt-submitted.sh +2 -86
  14. package/hooks.json +10 -10
  15. package/package.json +20 -20
  16. package/plugin.json +7 -6
  17. package/scripts/sync-command-surfaces.js +12 -54
  18. package/scripts/team-install.js +14 -84
  19. package/skills/cleanup/SKILL.md +21 -0
  20. package/skills/contrib/SKILL.md +34 -0
  21. package/skills/doctor/SKILL.md +5 -5
  22. package/skills/forever/SKILL.md +8 -0
  23. package/skills/help/SKILL.md +3 -2
  24. package/skills/observe/SKILL.md +1 -1
  25. package/skills/plugins/SKILL.md +257 -0
  26. package/skills/project-install/SKILL.md +18 -0
  27. package/skills/resume/SKILL.md +1 -1
  28. package/skills/retrospect/SKILL.md +48 -48
  29. package/skills/user-install/SKILL.md +3 -3
  30. package/skills/yolo/SKILL.md +8 -0
  31. package/versions.json +2 -1
  32. package/.github/plugin.json +0 -25
  33. package/hooks/proxied-hooks.json +0 -29
  34. package/hooks/session-end.ps1 +0 -69
  35. package/hooks/session-end.sh +0 -54
  36. package/hooks/session-start.ps1 +0 -111
  37. package/hooks/session-start.sh +0 -101
  38. package/hooks/user-prompt-submitted.ps1 +0 -52
  39. package/hooks/user-prompt-submitted.sh +0 -31
package/bin/cli.js CHANGED
@@ -5,13 +5,14 @@ const path = require('path');
5
5
  const { spawnSync } = require('child_process');
6
6
 
7
7
  const PACKAGE_ROOT = path.resolve(__dirname, '..');
8
+ let shared;
9
+ try { shared = require('./install-shared'); } catch {}
8
10
 
9
11
  function printUsage() {
10
12
  console.error([
11
13
  'Usage:',
12
14
  ' babysitter-github install [--global]',
13
15
  ' babysitter-github install --workspace [path]',
14
- ' babysitter-github install --cloud-agent [--workspace [path]]',
15
16
  ' babysitter-github uninstall',
16
17
  ].join('\n'));
17
18
  }
@@ -19,22 +20,15 @@ function printUsage() {
19
20
  function parseInstallArgs(argv) {
20
21
  let scope = 'global';
21
22
  let workspace = null;
22
- let cloudAgent = false;
23
23
  const passthrough = [];
24
24
 
25
25
  for (let i = 0; i < argv.length; i += 1) {
26
26
  const arg = argv[i];
27
27
  if (arg === '--global') {
28
- if (scope === 'workspace') {
29
- throw new Error('install accepts either --global or --workspace, not both');
30
- }
31
28
  scope = 'global';
32
29
  continue;
33
30
  }
34
31
  if (arg === '--workspace') {
35
- if (scope === 'global' && workspace !== null) {
36
- throw new Error('install accepts either --global or --workspace, not both');
37
- }
38
32
  scope = 'workspace';
39
33
  const next = argv[i + 1];
40
34
  if (next && !next.startsWith('-')) {
@@ -45,30 +39,17 @@ function parseInstallArgs(argv) {
45
39
  }
46
40
  continue;
47
41
  }
48
- if (arg === '--cloud-agent') {
49
- cloudAgent = true;
50
- passthrough.push(arg);
51
- continue;
52
- }
53
42
  passthrough.push(arg);
54
43
  }
55
44
 
56
- return {
57
- cloudAgent,
58
- scope,
59
- workspace,
60
- passthrough,
61
- };
45
+ return { scope, workspace, passthrough };
62
46
  }
63
47
 
64
48
  function runNodeScript(scriptPath, args, extraEnv = {}) {
65
49
  const result = spawnSync(process.execPath, [scriptPath, ...args], {
66
50
  cwd: process.cwd(),
67
51
  stdio: 'inherit',
68
- env: {
69
- ...process.env,
70
- ...extraEnv,
71
- },
52
+ env: { ...process.env, ...extraEnv },
72
53
  });
73
54
  process.exitCode = result.status ?? 1;
74
55
  }
@@ -82,9 +63,16 @@ function main() {
82
63
  }
83
64
 
84
65
  if (command === 'install') {
66
+ if (shared && typeof shared.harnessCliRoute === 'function' && shared.harnessCliRoute(rest, PACKAGE_ROOT, runNodeScript)) {
67
+ return;
68
+ }
85
69
  const parsed = parseInstallArgs(rest);
86
- if (parsed.cloudAgent) {
87
- runNodeScript(path.join(PACKAGE_ROOT, 'bin', 'install.js'), parsed.passthrough);
70
+ if (parsed.passthrough.includes('--cloud-agent')) {
71
+ const args = [...parsed.passthrough];
72
+ if (parsed.workspace) {
73
+ args.push('--workspace', parsed.workspace);
74
+ }
75
+ runNodeScript(path.join(PACKAGE_ROOT, 'bin', 'install.js'), args);
88
76
  return;
89
77
  }
90
78
  if (parsed.scope === 'workspace') {
@@ -96,7 +84,7 @@ function main() {
96
84
  runNodeScript(
97
85
  path.join(PACKAGE_ROOT, 'scripts', 'team-install.js'),
98
86
  args,
99
- { BABYSITTER_PACKAGE_ROOT: PACKAGE_ROOT },
87
+ { PLUGIN_PACKAGE_ROOT: PACKAGE_ROOT },
100
88
  );
101
89
  return;
102
90
  }