@a5c-ai/babysitter-opencode 0.1.4-staging.fd3ab4c2 → 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 (51) hide show
  1. package/README.md +2 -2
  2. package/bin/cli.cjs +1 -191
  3. package/bin/cli.js +90 -49
  4. package/bin/install-shared.cjs +1 -478
  5. package/bin/install-shared.js +615 -0
  6. package/bin/install.cjs +1 -143
  7. package/bin/install.js +18 -98
  8. package/bin/uninstall.cjs +1 -87
  9. package/bin/uninstall.js +12 -34
  10. package/commands/call.md +7 -7
  11. package/commands/contrib.md +31 -31
  12. package/commands/doctor.md +5 -5
  13. package/commands/forever.md +6 -6
  14. package/commands/help.md +245 -244
  15. package/commands/observe.md +12 -12
  16. package/commands/plan.md +7 -7
  17. package/commands/plugins.md +249 -249
  18. package/commands/project-install.md +10 -10
  19. package/commands/resume.md +8 -8
  20. package/commands/retrospect.md +55 -55
  21. package/commands/user-install.md +10 -10
  22. package/commands/yolo.md +7 -7
  23. package/hooks/babysitter-proxied-session-created.js +24 -0
  24. package/hooks/babysitter-proxied-session-created.sh +11 -0
  25. package/hooks/babysitter-proxied-session-idle.js +24 -0
  26. package/hooks/babysitter-proxied-session-idle.sh +3 -0
  27. package/hooks/babysitter-proxied-shell-env.js +24 -0
  28. package/hooks/babysitter-proxied-shell-env.sh +3 -0
  29. package/hooks/babysitter-proxied-tool-execute-after.js +24 -0
  30. package/hooks/babysitter-proxied-tool-execute-after.sh +3 -0
  31. package/hooks/babysitter-proxied-tool-execute-before.js +24 -0
  32. package/hooks/babysitter-proxied-tool-execute-before.sh +3 -0
  33. package/hooks/hooks.json +18 -18
  34. package/package.json +22 -19
  35. package/plugin.json +6 -4
  36. package/scripts/create-release-tag.mjs +18 -0
  37. package/scripts/publish-from-tag.mjs +12 -0
  38. package/scripts/team-install.js +23 -0
  39. package/skills/accomplish-status/SKILL.md +2 -0
  40. package/skills/babysit/SKILL.md +2 -0
  41. package/skills/doctor/SKILL.md +5 -5
  42. package/skills/help/SKILL.md +3 -2
  43. package/skills/observe/SKILL.md +1 -1
  44. package/versions.json +2 -2
  45. package/hooks/session-created.js +0 -181
  46. package/hooks/session-idle.js +0 -123
  47. package/hooks/shell-env.js +0 -87
  48. package/hooks/tool-execute-after.js +0 -106
  49. package/hooks/tool-execute-before.js +0 -108
  50. package/scripts/sync-command-docs.cjs +0 -105
  51. package/scripts/sync-command-surfaces.js +0 -52
@@ -1,105 +0,0 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
- const {
5
- listMarkdownBasenames,
6
- reportCheckResult,
7
- syncCommandMirrors,
8
- syncSkillsFromCommands,
9
- writeFileIfChanged,
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 COMMANDS_ROOT = path.join(PACKAGE_ROOT, 'commands');
16
- const SKILLS_ROOT = path.join(PACKAGE_ROOT, 'skills');
17
- const LABEL = 'babysitter-opencode sync';
18
-
19
- const BABYSIT_SKILL = `---
20
- name: babysit
21
- description: Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)
22
- ---
23
-
24
- # babysit
25
-
26
- Orchestrate \`.a5c/runs/<runId>/\` through iterative execution.
27
-
28
- ## Dependencies
29
-
30
- ### Babysitter SDK and CLI
31
-
32
- Read the SDK version from \`versions.json\` to ensure version compatibility:
33
-
34
- \`\`\`bash
35
- SDK_VERSION=$(node -e "try{const fs=require('fs');const probes=['./plugins/babysitter-opencode/versions.json','./node_modules/@a5c-ai/babysitter-opencode/versions.json'];for(const probe of probes){if(fs.existsSync(probe)){console.log(JSON.parse(fs.readFileSync(probe,'utf8')).sdkVersion||'latest');process.exit(0)}}console.log('latest')}catch{console.log('latest')}")
36
- CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
37
- \`\`\`
38
-
39
- ## Instructions
40
-
41
- Run the following command to get full orchestration instructions:
42
-
43
- \`\`\`bash
44
- babysitter instructions:babysit-skill --harness opencode --interactive
45
- \`\`\`
46
-
47
- For non-interactive mode:
48
-
49
- \`\`\`bash
50
- babysitter instructions:babysit-skill --harness opencode --no-interactive
51
- \`\`\`
52
-
53
- Follow the instructions returned by the command above to orchestrate the run.
54
- `;
55
-
56
- function getCommandNames() {
57
- return listMarkdownBasenames(ROOT_COMMANDS);
58
- }
59
-
60
- function main() {
61
- const check = process.argv.includes('--check');
62
- const commandNames = getCommandNames();
63
- const mirrorResult = syncCommandMirrors({
64
- label: LABEL,
65
- sourceRoot: ROOT_COMMANDS,
66
- targetRoot: COMMANDS_ROOT,
67
- names: commandNames,
68
- check,
69
- cwd: PACKAGE_ROOT,
70
- });
71
- const skillsResult = syncSkillsFromCommands({
72
- label: LABEL,
73
- sourceRoot: COMMANDS_ROOT,
74
- skillsRoot: SKILLS_ROOT,
75
- names: commandNames,
76
- check,
77
- cwd: PACKAGE_ROOT,
78
- });
79
-
80
- const babysitSkillPath = path.join(SKILLS_ROOT, 'babysit', 'SKILL.md');
81
- if (check) {
82
- const fs = require('fs');
83
- const stale = [...mirrorResult.stale, ...skillsResult.stale];
84
- const current = fs.existsSync(babysitSkillPath)
85
- ? fs.readFileSync(babysitSkillPath, 'utf8')
86
- : null;
87
- if (current !== BABYSIT_SKILL) {
88
- stale.push(path.relative(PACKAGE_ROOT, babysitSkillPath));
89
- }
90
- reportCheckResult(LABEL, stale);
91
- return;
92
- }
93
-
94
- const babysitUpdated = writeFileIfChanged(babysitSkillPath, BABYSIT_SKILL) ? 1 : 0;
95
- const updated = mirrorResult.updated + skillsResult.updated + babysitUpdated;
96
-
97
- if (updated === 0) {
98
- console.log(`[${LABEL}] no OpenCode command or skill changes were needed.`);
99
- return;
100
- }
101
-
102
- console.log(`[${LABEL}] updated ${updated} OpenCode command/skill file(s).`);
103
- }
104
-
105
- main();
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Sync command surfaces from the canonical babysitter plugin.
4
- *
5
- * Copies command .md files from the cursor/codex plugins or generates
6
- * them from the SDK CLI command definitions. Used during build/deploy
7
- * to keep command surfaces in sync across harness plugins.
8
- */
9
-
10
- "use strict";
11
-
12
- const fs = require("fs");
13
- const path = require("path");
14
-
15
- const PLUGIN_ROOT = path.resolve(__dirname, "..");
16
- const COMMANDS_DIR = path.join(PLUGIN_ROOT, "commands");
17
-
18
- // Check mode
19
- const checkOnly = process.argv.includes("--check");
20
-
21
- function main() {
22
- // Verify commands directory exists and has files
23
- if (!fs.existsSync(COMMANDS_DIR)) {
24
- console.error("ERROR: commands/ directory not found");
25
- process.exit(1);
26
- }
27
-
28
- const files = fs.readdirSync(COMMANDS_DIR).filter(f => f.endsWith(".md"));
29
- if (files.length === 0) {
30
- console.error("ERROR: No command .md files found in commands/");
31
- process.exit(1);
32
- }
33
-
34
- console.log(`Found ${files.length} command files:`);
35
- for (const file of files) {
36
- const content = fs.readFileSync(path.join(COMMANDS_DIR, file), "utf8");
37
- const hasHeader = content.startsWith("---");
38
- const status = hasHeader ? "OK" : "MISSING FRONTMATTER";
39
- console.log(` ${file} [${status}]`);
40
- if (checkOnly && !hasHeader) {
41
- process.exit(1);
42
- }
43
- }
44
-
45
- if (checkOnly) {
46
- console.log("\nAll command files are valid.");
47
- } else {
48
- console.log("\nCommand surfaces synced.");
49
- }
50
- }
51
-
52
- main();