@a5c-ai/babysitter-github 0.1.5-staging.f6cb97d6 → 5.0.0

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 (48) 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/call.md +7 -7
  6. package/commands/contrib.md +31 -31
  7. package/commands/doctor.md +5 -5
  8. package/commands/forever.md +6 -6
  9. package/commands/help.md +245 -244
  10. package/commands/observe.md +12 -12
  11. package/commands/plan.md +7 -7
  12. package/commands/plugins.md +249 -249
  13. package/commands/project-install.md +10 -10
  14. package/commands/resume.md +8 -8
  15. package/commands/retrospect.md +55 -55
  16. package/commands/user-install.md +10 -10
  17. package/commands/yolo.md +7 -7
  18. package/hooks/babysitter-proxied-session-end.ps1 +12 -0
  19. package/hooks/babysitter-proxied-session-end.sh +3 -0
  20. package/hooks/babysitter-proxied-session-start.ps1 +12 -0
  21. package/hooks/babysitter-proxied-session-start.sh +11 -0
  22. package/hooks/babysitter-proxied-user-prompt-submitted.ps1 +12 -0
  23. package/hooks/babysitter-proxied-user-prompt-submitted.sh +3 -0
  24. package/hooks.json +9 -9
  25. package/package.json +20 -21
  26. package/plugin.json +9 -5
  27. package/scripts/create-release-tag.mjs +18 -0
  28. package/scripts/publish-from-tag.mjs +12 -0
  29. package/scripts/team-install.js +14 -84
  30. package/skills/babysit/SKILL.md +2 -0
  31. package/skills/cleanup/SKILL.md +21 -0
  32. package/skills/contrib/SKILL.md +34 -0
  33. package/skills/doctor/SKILL.md +5 -5
  34. package/skills/forever/SKILL.md +8 -0
  35. package/skills/help/SKILL.md +3 -2
  36. package/skills/observe/SKILL.md +1 -1
  37. package/skills/plugins/SKILL.md +257 -0
  38. package/skills/project-install/SKILL.md +18 -0
  39. package/skills/yolo/SKILL.md +8 -0
  40. package/versions.json +2 -1
  41. package/.github/plugin.json +0 -25
  42. package/hooks/session-end.ps1 +0 -68
  43. package/hooks/session-end.sh +0 -65
  44. package/hooks/session-start.ps1 +0 -110
  45. package/hooks/session-start.sh +0 -100
  46. package/hooks/user-prompt-submitted.ps1 +0 -51
  47. package/hooks/user-prompt-submitted.sh +0 -41
  48. package/scripts/sync-command-surfaces.js +0 -62
@@ -1,51 +0,0 @@
1
- # Babysitter userPromptSubmitted Hook for GitHub Copilot CLI (PowerShell)
2
- # Applies density-filter compression to long user prompts.
3
- #
4
- # NOTE: Output from this hook is IGNORED by Copilot CLI.
5
- # This hook is for logging and side-effects only.
6
-
7
- $ErrorActionPreference = "Continue"
8
-
9
- $PluginRoot = if ($env:COPILOT_PLUGIN_DIR) { $env:COPILOT_PLUGIN_DIR } else { Split-Path -Parent $PSScriptRoot }
10
-
11
- # Resolve babysitter CLI
12
- $hasBabysitter = [bool](Get-Command babysitter -ErrorAction SilentlyContinue)
13
- $useFallback = $false
14
-
15
- if (-not $hasBabysitter) {
16
- $localBin = Join-Path $env:USERPROFILE ".local\bin\babysitter.cmd"
17
- if (Test-Path $localBin) {
18
- $env:PATH = "$(Split-Path $localBin);$env:PATH"
19
- $hasBabysitter = $true
20
- } else {
21
- $versionsFile = Join-Path $PluginRoot "versions.json"
22
- try {
23
- $SdkVersion = (Get-Content $versionsFile -Raw | ConvertFrom-Json).sdkVersion
24
- if (-not $SdkVersion) { $SdkVersion = "latest" }
25
- } catch {
26
- $SdkVersion = "latest"
27
- }
28
- $useFallback = $true
29
- }
30
- }
31
-
32
- $LogDir = if ($env:BABYSITTER_LOG_DIR) { $env:BABYSITTER_LOG_DIR } else { Join-Path $HOME ".a5c\logs" }
33
- New-Item -ItemType Directory -Path $LogDir -Force -ErrorAction SilentlyContinue | Out-Null
34
-
35
- # Capture stdin
36
- $InputFile = [System.IO.Path]::GetTempFileName()
37
- $input | Out-File -FilePath $InputFile -Encoding utf8
38
-
39
- $stderrLog = Join-Path $LogDir "babysitter-user-prompt-submitted-hook-stderr.log"
40
-
41
- try {
42
- if ($useFallback) {
43
- Get-Content $InputFile | & npx -y "@a5c-ai/babysitter-sdk@$SdkVersion" hook:run --hook-type user-prompt-submitted --harness github-copilot --json 2>$stderrLog | Out-Null
44
- } elseif ($hasBabysitter) {
45
- Get-Content $InputFile | & babysitter hook:run --hook-type user-prompt-submitted --harness github-copilot --json 2>$stderrLog | Out-Null
46
- }
47
- } catch {}
48
-
49
- Remove-Item $InputFile -Force -ErrorAction SilentlyContinue
50
-
51
- exit 0
@@ -1,41 +0,0 @@
1
- #!/bin/bash
2
- # Babysitter userPromptSubmitted Hook for GitHub Copilot CLI
3
- # Applies density-filter compression to long user prompts.
4
- # Delegates to SDK CLI: babysitter hook:run --hook-type user-prompt-submitted
5
- #
6
- # NOTE: Output from this hook is IGNORED by Copilot CLI.
7
- # This hook is for logging and side-effects only.
8
-
9
- PLUGIN_ROOT="${COPILOT_PLUGIN_DIR:-$(cd "$(dirname "$0")/.." && pwd)}"
10
-
11
- # Resolve babysitter CLI: installed binary, user-local prefix, or npx fallback
12
- if ! command -v babysitter &>/dev/null; then
13
- if [ -x "$HOME/.local/bin/babysitter" ]; then
14
- export PATH="$HOME/.local/bin:$PATH"
15
- else
16
- SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${PLUGIN_ROOT}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}" 2>/dev/null || echo "latest")
17
- if [ -n "$SDK_VERSION" ]; then
18
- babysitter() { npx -y "@a5c-ai/babysitter-sdk@${SDK_VERSION}" "$@"; }
19
- export -f babysitter
20
- else
21
- # No CLI available -- exit silently
22
- exit 0
23
- fi
24
- fi
25
- fi
26
-
27
- LOG_DIR="${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}"
28
- mkdir -p "$LOG_DIR" 2>/dev/null
29
-
30
- INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/hook-user-prompt-submitted-$$.json")
31
- cat > "$INPUT_FILE"
32
-
33
- babysitter log --type hook --label "hook:user-prompt-submitted" --message "Hook invoked" --source shell-hook 2>/dev/null || true
34
-
35
- babysitter hook:run --hook-type user-prompt-submitted --harness github-copilot --json < "$INPUT_FILE" 2>"$LOG_DIR/babysitter-user-prompt-submitted-hook-stderr.log" || true
36
-
37
- babysitter log --type hook --label "hook:user-prompt-submitted" --message "Hook complete" --source shell-hook 2>/dev/null || true
38
-
39
- rm -f "$INPUT_FILE" 2>/dev/null
40
-
41
- exit 0
@@ -1,62 +0,0 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
- const {
5
- listDirectories,
6
- listMarkdownBasenames,
7
- reportCheckResult,
8
- syncCommandMirrors,
9
- syncSkillsFromCommands,
10
- } = require('../../../scripts/plugin-command-sync-lib.cjs');
11
-
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';
18
-
19
- function getMirroredCommandNames() {
20
- const local = new Set(listMarkdownBasenames(PLUGIN_COMMANDS));
21
- return listMarkdownBasenames(ROOT_COMMANDS).filter((name) => local.has(name));
22
- }
23
-
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
- }
61
-
62
- main();