@a5c-ai/babysitter-omp 0.1.0 → 0.1.1-staging.0dc03363

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 (61) hide show
  1. package/AGENTS.md +131 -0
  2. package/README.md +79 -36
  3. package/bin/cli.cjs +3 -11
  4. package/bin/install.cjs +25 -124
  5. package/bin/uninstall.cjs +9 -29
  6. package/commands/assimilate.md +37 -0
  7. package/commands/call.md +7 -0
  8. package/commands/cleanup.md +20 -0
  9. package/commands/contrib.md +33 -0
  10. package/commands/doctor.md +426 -0
  11. package/commands/forever.md +7 -0
  12. package/commands/help.md +244 -0
  13. package/commands/observe.md +12 -0
  14. package/commands/plan.md +7 -0
  15. package/commands/plugins.md +255 -0
  16. package/commands/project-install.md +17 -0
  17. package/commands/resume.md +8 -0
  18. package/commands/retrospect.md +55 -0
  19. package/commands/user-install.md +17 -0
  20. package/commands/yolo.md +7 -0
  21. package/extensions/index.ts +55 -0
  22. package/package.json +9 -7
  23. package/scripts/sync-command-docs.cjs +72 -81
  24. package/skills/assimilate/SKILL.md +38 -0
  25. package/skills/babysit/SKILL.md +36 -0
  26. package/skills/call/SKILL.md +8 -0
  27. package/skills/cleanup/SKILL.md +21 -0
  28. package/skills/contrib/SKILL.md +34 -0
  29. package/skills/doctor/SKILL.md +427 -0
  30. package/skills/forever/SKILL.md +8 -0
  31. package/skills/help/SKILL.md +245 -0
  32. package/skills/observe/SKILL.md +13 -0
  33. package/skills/plan/SKILL.md +8 -0
  34. package/skills/plugins/SKILL.md +257 -0
  35. package/skills/project-install/SKILL.md +18 -0
  36. package/skills/resume/SKILL.md +9 -0
  37. package/skills/retrospect/SKILL.md +56 -0
  38. package/skills/user-install/SKILL.md +18 -0
  39. package/skills/yolo/SKILL.md +8 -0
  40. package/versions.json +3 -0
  41. package/commands/babysitter-call.md +0 -12
  42. package/commands/babysitter-doctor.md +0 -10
  43. package/commands/babysitter-resume.md +0 -16
  44. package/commands/babysitter-status.md +0 -15
  45. package/extensions/babysitter/cli-wrapper.ts +0 -95
  46. package/extensions/babysitter/constants.ts +0 -77
  47. package/extensions/babysitter/custom-tools.ts +0 -208
  48. package/extensions/babysitter/effect-executor.ts +0 -362
  49. package/extensions/babysitter/guards.ts +0 -257
  50. package/extensions/babysitter/index.ts +0 -554
  51. package/extensions/babysitter/loop-driver.ts +0 -256
  52. package/extensions/babysitter/result-poster.ts +0 -115
  53. package/extensions/babysitter/sdk-bridge.ts +0 -243
  54. package/extensions/babysitter/session-binder.ts +0 -284
  55. package/extensions/babysitter/status-line.ts +0 -54
  56. package/extensions/babysitter/task-interceptor.ts +0 -82
  57. package/extensions/babysitter/todo-replacement.ts +0 -125
  58. package/extensions/babysitter/tool-renderer.ts +0 -263
  59. package/extensions/babysitter/tui-widgets.ts +0 -164
  60. package/extensions/babysitter/types.ts +0 -222
  61. package/skills/babysitter/SKILL.md +0 -45
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: observe
3
+ description: Launch the babysitter observer dashboard. Installs and runs the real-time observer UI that watches babysitter runs, displaying task progress, journal events, and orchestration state in your browser.
4
+ ---
5
+
6
+ # observe
7
+
8
+ Run the babysitter observer dashboard:
9
+
10
+ 1. Determine the watch directory — this is usually the project's container directory (the parent of the project dir), or the current working directory if not specified.
11
+ 2. Launch the dashboard: `npx -y @a5c-ai/babysitter-observer-dashboard@latest --watch-dir <dir>`
12
+ 3. This is a blocking process — it will keep running until stopped.
13
+ 4. Open the browser at the URL printed by the dashboard.
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: plan
3
+ description: Plan a babysitter run. use this command to plan a complex workflow, without actually running it.
4
+ ---
5
+
6
+ # plan
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). focus on creating the best process possible, but without creating and running the actual run.
@@ -0,0 +1,257 @@
1
+ ---
2
+ name: plugins
3
+ description: manage babysitter plugins. use this command to see the list of installed babysitter plugins, their status, and manage them (install, update, uninstall, list from marketplace, add marketplace, configure plugin, create new plugin, etc).
4
+ ---
5
+
6
+ # plugins
7
+
8
+ This command installs and manages plugins for babysitter. A plugin is a version-managed package of contextual instructions (for install, uninstall, configure, and update/migrate between versions), not a conventional software plugin.
9
+
10
+ if the command is run without arguments, it lists all installed plugins with their name, version, marketplace, installation date, and last update date. as well as marketplaces added to the system. and instructions on how to install new plugins from marketplaces.
11
+ if there are no marketplaces added, add the default marketplace:
12
+ ```bash
13
+ babysitter plugin:add-marketplace --marketplace-url https://github.com/a5c-ai/babysitter --marketplace-path plugins/a5c/marketplace/marketplace.json --global --json
14
+ ```
15
+
16
+ Plugins can be installed at two scopes:
17
+ - **global** (`--global`): stored under `~/.a5c/`, available for all projects
18
+ - **project** (`--project`): stored under `<projectDir>/.a5c/`, project-specific
19
+
20
+ ## Marketplace Management
21
+
22
+ Marketplaces are git repositories containing a `marketplace.json` manifest and plugin package directories. The SDK clones them locally with `--depth 1`.
23
+
24
+ **Storage locations:**
25
+ - Global: `~/.a5c/marketplaces/<name>/`
26
+ - Project: `<projectDir>/.a5c/marketplaces/<name>/`
27
+
28
+ The marketplace name is derived from the git URL's last path segment (stripping `.git` suffix and trailing slashes).
29
+
30
+ ### Adding a marketplace
31
+
32
+ ```bash
33
+ babysitter plugin:add-marketplace --marketplace-url <url> [--marketplace-path <relative-path>] [--marketplace-branch <ref>] [--force] --global|--project [--json]
34
+ ```
35
+
36
+ Clones the marketplace repository to the local marketplaces directory. Use `--marketplace-path` to specify the relative path to `marketplace.json` within the repo (for monorepos or repos where the manifest is not at the root). Use `--marketplace-branch` to clone a specific branch, tag, or ref (defaults to the repo's default branch). Use `--force` to replace an existing marketplace clone (deletes and re-clones).
37
+
38
+ ### Updating a marketplace
39
+
40
+ ```bash
41
+ babysitter plugin:update-marketplace --marketplace-name <name> [--marketplace-branch <ref>] --global|--project [--json]
42
+ ```
43
+
44
+ Runs `git pull` on the local marketplace clone to fetch latest changes. Use `--marketplace-branch` to switch to a different branch before pulling (works even with shallow clones).
45
+
46
+ ### Listing plugins in a marketplace
47
+
48
+ ```bash
49
+ babysitter plugin:list-plugins --marketplace-name <name> --global|--project [--json]
50
+ ```
51
+
52
+ Reads the `marketplace.json` manifest and returns all available plugins sorted alphabetically by name. Each entry includes: name, description, latestVersion, versions array, packagePath, tags, and author.
53
+
54
+ ## Plugin Installation
55
+
56
+ **Note:** For `plugin:install`, `plugin:update`, `plugin:configure`, and `plugin:list-plugins`, the `--marketplace-name` flag is auto-detected when only one marketplace is cloned for the given scope. You can omit it if there's only one marketplace.
57
+
58
+ ### Flow
59
+
60
+ 1. Update the marketplace: `babysitter plugin:update-marketplace --marketplace-name <name> --global|--project`
61
+ 2. Check current state: `babysitter plugin:list-installed --global|--project` to see installed plugins and versions
62
+ 3. Install the plugin:
63
+
64
+ ```bash
65
+ babysitter plugin:install --plugin-name <name> [--marketplace-name <mp>] --global|--project [--json]
66
+ ```
67
+
68
+ This command resolves the plugin package path from the marketplace manifest, reads `install.md` from the plugin package directory, and returns the installation instructions. If an `install-process.js` file exists, the instructions may reference it as an automated install process.
69
+
70
+ 4. The agent performs the installation steps as defined in `install.md`
71
+ 5. The agent updates the registry:
72
+
73
+ ```bash
74
+ babysitter plugin:update-registry --plugin-name <name> --plugin-version <ver> --marketplace-name <mp> --global|--project [--json]
75
+ ```
76
+
77
+ ## Plugin Update (with migrations)
78
+
79
+ ```bash
80
+ babysitter plugin:update --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
81
+ ```
82
+
83
+ This command:
84
+ 1. Reads the currently installed version from the registry
85
+ 2. Resolves the latest version from the marketplace manifest
86
+ 3. Looks in the plugin package's `migrations/` directory for migration files
87
+ 4. Uses BFS over the migration graph to find the shortest path from the installed version to the target version
88
+ 5. Returns the ordered migration instructions (content of each migration file in sequence)
89
+
90
+ **Migration filename format:** `<fromVersion>_to_<toVersion>.<ext>` where:
91
+ - Versions may contain alphanumerics, dots, dashes (e.g. `1.0.0`, `2.0.0-beta`)
92
+ - Extensions: `.md` for markdown instructions, `.js` for executable process files
93
+ - Examples: `1.0.0_to_1.1.0.md`, `2.0.0-beta_to_2.0.0.js`
94
+
95
+ After performing the migration steps, update the registry:
96
+
97
+ ```bash
98
+ babysitter plugin:update-registry --plugin-name <name> --plugin-version <new-ver> --marketplace-name <mp> --global|--project [--json]
99
+ ```
100
+
101
+ ## Plugin Uninstallation
102
+
103
+ ```bash
104
+ babysitter plugin:uninstall --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
105
+ ```
106
+
107
+ Reads `uninstall.md` from the plugin package directory and returns the uninstall instructions. After performing the uninstall steps, remove from registry:
108
+
109
+ ```bash
110
+ babysitter plugin:remove-from-registry --plugin-name <name> --global|--project [--json]
111
+ ```
112
+
113
+ ## Plugin Configuration
114
+
115
+ ```bash
116
+ babysitter plugin:configure --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
117
+ ```
118
+
119
+ Reads `configure.md` from the plugin package directory and returns configuration instructions.
120
+
121
+ ## Registry Management
122
+
123
+ The plugin registry (`plugin-registry.json`) tracks installed plugins with schema version `2026.01.plugin-registry-v1`. Writes use atomic file operations (temp + rename) for crash safety.
124
+
125
+ **Storage locations:**
126
+ - Global: `~/.a5c/plugin-registry.json`
127
+ - Project: `<projectDir>/.a5c/plugin-registry.json`
128
+
129
+ ### List installed plugins
130
+
131
+ ```bash
132
+ babysitter plugin:list-installed --global|--project [--json]
133
+ ```
134
+
135
+ Returns all installed plugins sorted alphabetically. In `--json` mode, returns an array of registry entries. In human mode, displays a formatted table with name, version, marketplace, and timestamps.
136
+
137
+ ### Remove from registry
138
+
139
+ ```bash
140
+ babysitter plugin:remove-from-registry --plugin-name <name> --global|--project [--json]
141
+ ```
142
+
143
+ Removes a plugin entry from the registry. Returns error if the plugin is not present.
144
+
145
+ ## Plugin Creation
146
+
147
+ To create a new plugin package from scratch, use the `meta/plugin-creation` babysitter process. This process guides you through requirements analysis, structure design, instruction authoring, optional process file generation, validation, and marketplace integration.
148
+
149
+ ### Using the plugin creation process
150
+
151
+ Orchestrate a babysitter run with the plugin creation process:
152
+
153
+ ```bash
154
+ # Create inputs file
155
+ cat > /tmp/plugin-inputs.json << 'EOF'
156
+ {
157
+ "pluginName": "my-plugin",
158
+ "description": "What the plugin does — be specific about install/configure/uninstall behavior",
159
+ "scope": "project",
160
+ "outputDir": "./plugins",
161
+ "components": {
162
+ "installProcess": false,
163
+ "configureProcess": false,
164
+ "uninstallProcess": false,
165
+ "migrations": false,
166
+ "processFiles": false
167
+ },
168
+ "marketplace": {
169
+ "name": "my-marketplace",
170
+ "author": "my-org",
171
+ "tags": ["category1", "category2"]
172
+ }
173
+ }
174
+ EOF
175
+
176
+ # Create and run
177
+ babysitter run:create \
178
+ --process-id meta/plugin-creation \
179
+ --entry library/specializations/meta/plugin-creation.js#process \
180
+ --inputs /tmp/plugin-inputs.json \
181
+ --prompt "Create a new babysitter plugin package" \
182
+ --json
183
+ ```
184
+
185
+ ### What the process generates
186
+
187
+ The process creates a complete plugin package directory:
188
+
189
+ | File | Description |
190
+ |------|-------------|
191
+ | `install.md` | Agent-readable installation instructions with numbered steps |
192
+ | `uninstall.md` | Reversal instructions for clean removal |
193
+ | `configure.md` | Configuration options table and adjustment instructions |
194
+ | `install-process.js` | *(optional)* Automated babysitter process for complex install steps |
195
+ | `configure-process.js` | *(optional)* Automated configuration process |
196
+ | `process/main.js` | *(optional)* Main process the plugin contributes |
197
+ | `marketplace-entry.json` | Ready-to-use marketplace.json entry for publishing |
198
+
199
+ ### Process phases
200
+
201
+ 1. **Requirements Analysis** — Analyzes plugin purpose, prerequisites, config options, file structure
202
+ 2. **Structure Design** — Plans directory layout and file inventory (with review breakpoint)
203
+ 3. **Instruction Authoring** — Writes install.md, uninstall.md, configure.md
204
+ 4. **Process Files** — Creates optional babysitter process files (install-process.js, configure-process.js, process/main.js)
205
+ 5. **Validation** — Verifies package completeness, instruction quality, path correctness
206
+ 6. **Marketplace Integration** — Generates marketplace.json entry for publishing
207
+
208
+ ### Quick creation (without orchestration)
209
+
210
+ For simple plugins that only need instruction files, you can create the package manually following the structure below and the [Plugin Author Guide](docs/plugins/plugin-author-guide.md).
211
+
212
+ ## Plugin Package Structure
213
+
214
+ ```
215
+ my-plugin/
216
+ package.json # Optional (name field used as plugin ID, falls back to directory name)
217
+ install.md # Markdown instructions for installation
218
+ uninstall.md # Markdown instructions for removal
219
+ configure.md # Markdown instructions for configuration
220
+ install-process.js # Optional automated install process
221
+ uninstall-process.js # Optional automated uninstall process
222
+ configure-process.js # Optional automated configure process
223
+ migrations/ # Version migration files
224
+ 1.0.0_to_1.1.0.md
225
+ 1.1.0_to_2.0.0.js
226
+ process/ # Process definition files (collected recursively)
227
+ main.js
228
+ ```
229
+
230
+ ## All CLI Commands Summary
231
+
232
+ All commands accept `--json` for machine-readable output and `--global|--project`.
233
+
234
+ | Command | Required Flags | Description |
235
+ |---------|---------------|-------------|
236
+ | `plugin:add-marketplace` | `--marketplace-url`, `--global\|--project` [`--marketplace-path`, `--marketplace-branch`, `--force`] | Clone a marketplace repository |
237
+ | `plugin:update-marketplace` | `--marketplace-name`, `--global\|--project` [`--marketplace-branch`] | Pull latest marketplace changes (optionally switch branch) |
238
+ | `plugin:list-plugins` | `--marketplace-name`, `--global\|--project` | List available plugins in a marketplace |
239
+ | `plugin:install` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Get install instructions for a plugin |
240
+ | `plugin:uninstall` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Get uninstall instructions for a plugin |
241
+ | `plugin:update` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Resolve migration chain and get update instructions |
242
+ | `plugin:configure` | `--plugin-name`, `--marketplace-name`, `--global\|--project` | Get configuration instructions for a plugin |
243
+ | `plugin:list-installed` | `--global\|--project` | List all installed plugins |
244
+ | `plugin:update-registry` | `--plugin-name`, `--plugin-version`, `--marketplace-name`, `--global\|--project` | Register or update a plugin entry |
245
+ | `plugin:remove-from-registry` | `--plugin-name`, `--global\|--project` | Remove a plugin entry from the registry |
246
+
247
+ ## After Plugin Work: Contribute Back
248
+
249
+ After working with plugins, prompt the user to share improvements or report issues:
250
+
251
+ - **Improved a plugin's install/configure/uninstall instructions**: `/babysitter:contrib library contribution: improved [plugin-name] [install|configure|uninstall] instructions`
252
+ - **Created a new plugin**: `/babysitter:contrib library contribution: new plugin [plugin-name] -- [description]`
253
+ - **Found a bug in a plugin or the plugin system**: `/babysitter:contrib bug report: [description, e.g. "plugin:update-registry fails when marketplace hasn't been cloned"]`
254
+ - **Plugin install/configure instructions were confusing or wrong**: `/babysitter:contrib bug report: [plugin-name] install instructions [description of what was wrong]`
255
+ - **Have an idea for a new plugin**: `/babysitter:contrib feature request: plugin idea -- [description]`
256
+
257
+ Even reporting that a plugin's instructions were unclear helps improve it for the next user.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: project-install
3
+ description: Set up a project for babysitting. Guides you through onboarding a new or existing project — researches the codebase, interviews you about goals and workflows, builds the project profile, installs the best tools, and optionally configures CI/CD integration.
4
+ ---
5
+
6
+ # project-install
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
9
+
10
+ Before using the process library, resolve the active library root through the SDK CLI. If no binding exists yet, initialize the shared global SDK binding with:
11
+
12
+ ```bash
13
+ babysitter process-library:active --json
14
+ ```
15
+
16
+ Then use the `cradle/project-install` process from the active process library.
17
+
18
+ When the run completes, end with a friendly message that includes a polite and humorous ask to star the repo on GitHub: https://github.com/a5c-ai/babysitter
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: resume
3
+ description: Resume orchestrating of a babysitter run. use this command to resume babysitting a complex workflow.
4
+ ---
5
+
6
+ # resume
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). to resume a run.
9
+ if no run was given, discover the runs and suggest which incomplete run to resume based on the run's status, inputs, process , etc.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: retrospect
3
+ description: Analysis for a run and its results, process, suggestions for process improvements, process optimizations, fixes, etc. for the next runs.
4
+ ---
5
+
6
+ # retrospect
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
9
+
10
+ create and run a retrospect process:
11
+
12
+ ### Run Selection
13
+
14
+ - `--all` or "all runs": list all completed/failed runs and analyze collectively
15
+ - Multiple run IDs: analyze each specified run
16
+ - Single run ID or no ID: existing behavior (latest run)
17
+ - In interactive mode with no run specified: ask user whether to analyze latest, select specific runs, or all runs
18
+
19
+ ### Cross-Run Analysis (multi-run mode)
20
+
21
+ When analyzing multiple runs, the retrospect process should additionally cover:
22
+ - Common failure patterns across runs
23
+ - Velocity trends (tasks/time across runs)
24
+ - Process evolution (how processes changed)
25
+ - Repeated breakpoint patterns
26
+ - Aggregate quality metrics
27
+
28
+ implementations notes (for the process):
29
+ - The process should analyze the run, the process that was followed, and provide suggestions for improvements, optimizations, and fixes.
30
+ - The process should such have many breakpoints where the user can steer the process, provide feedback, and make decisions about how to proceed with the retrospect.
31
+ - The process should be designed to be flexible and adaptable to different types of runs, projects, and goals, and should be able to provide insights and suggestions that are relevant and actionable for the user. (modification to the process, skills, etc.)
32
+ - The process should be designed to be iterative, allowing the user to go through multiple rounds of analysis and improvement, and should be able to track the changes and improvements made over time.
33
+ - The process should cover:
34
+ - Analysis of the run and its results, including what went well, what didn't go well, and what could be improved.
35
+ - Analysis of the process that was followed, including what steps were taken, what tools were used, and how effective they were.
36
+ - Suggestions for improvements, optimizations, and fixes for both the run and the process.
37
+ - Implementing the improvements, optimizations, and fixes, and tracking the changes made over time.
38
+ ### Cleanup Suggestion
39
+
40
+ After retrospect analysis, suggest running `/babysitter:cleanup` to clean up old run data and reclaim disk space.
41
+
42
+ - Ending by explicitly prompting the user to contribute back -- even just reporting an issue is valuable, they don't need to implement the fix themselves. After analysis, display a clear call-to-action:
43
+
44
+ "You've identified [specific insight/improvement]. This could help other babysitter users too. Run `/babysitter:contrib` to share it upstream -- you can either report it as an issue or submit a PR with the fix."
45
+
46
+ Route to the specific contrib workflow based on what the user wants to do:
47
+
48
+ **Just reporting (no code changes needed):**
49
+ - Found a bug or weakness in a process -> `/babysitter:contrib bug report: [description of what went wrong]`
50
+ - Found missing or confusing documentation -> `/babysitter:contrib documentation question: [what was unclear]`
51
+ - Have an idea for improvement but don't want to implement it -> `/babysitter:contrib feature request: [description]`
52
+
53
+ **Contributing code changes:**
54
+ - Process/skill/agent improvements -> `/babysitter:contrib library contribution: [description]`
55
+ - Bug fixes in SDK or CLI -> `/babysitter:contrib bugfix: [description]`
56
+ - Plugin instruction improvements -> `/babysitter:contrib library contribution: improved [plugin-name] [install|configure|uninstall] instructions`
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: user-install
3
+ description: Set up babysitter for yourself. Guides you through onboarding — installs dependencies, interviews you about your specialties and preferences, builds your user profile, and configures the best tools for your workflow.
4
+ ---
5
+
6
+ # user-install
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
9
+
10
+ Before using the process library, resolve the active library root through the SDK CLI. If no binding exists yet, initialize the shared global SDK binding with:
11
+
12
+ ```bash
13
+ babysitter process-library:active --json
14
+ ```
15
+
16
+ Then use the `cradle/user-install` process from the active process library.
17
+
18
+ When the run completes, end with a friendly message that includes a polite and humorous ask to star the repo on GitHub: https://github.com/a5c-ai/babysitter
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: yolo
3
+ description: Orchestrate a babysitter run. use this command to start babysitting a complex workflow in a non-interactive mode, without any user interaction or breakpoints in the run.
4
+ ---
5
+
6
+ # yolo
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). but without any user interaction or breakpoints in the run.
package/versions.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "sdkVersion": "0.0.184-staging.0dc03363"
3
+ }
@@ -1,12 +0,0 @@
1
- ---
2
- name: babysitter:call
3
- description: Start a babysitter orchestration run
4
- arguments:
5
- - name: prompt
6
- description: The task to orchestrate
7
- required: true
8
- ---
9
-
10
- Start a babysitter orchestration run. Creates a new run using the SDK, binds it to the current session, and begins iteration.
11
-
12
- This command initialises a fresh babysitter run with the given prompt, associates it with the active oh-my-pi session, and kicks off the first orchestration iteration. The loop driver will continue iterating automatically on subsequent `agent_end` events until the run completes, fails, or a guard trips.
@@ -1,10 +0,0 @@
1
- ---
2
- name: babysitter:doctor
3
- description: Diagnose the health of a babysitter run
4
- arguments:
5
- - name: runId
6
- description: Optional run ID to diagnose (defaults to the active run)
7
- required: false
8
- ---
9
-
10
- Run diagnostic checks against a babysitter run to identify potential issues. Inspects run metadata, journal integrity, state cache, lock files, and effect health.
@@ -1,16 +0,0 @@
1
- ---
2
- name: babysitter:resume
3
- description: Resume a previously stopped or interrupted babysitter run
4
- arguments:
5
- - name: runId
6
- description: The run ID to resume
7
- required: true
8
- ---
9
-
10
- Resume an existing babysitter orchestration run that was previously stopped, interrupted, or is in a waiting state. Re-binds the run to the current session and continues iteration from where it left off.
11
-
12
- ## Behaviour
13
-
14
- 1. Locates the run directory for the given run ID.
15
- 2. Reads run metadata and journal to determine current state.
16
- 3. Re-binds the run to the active oh-my-pi session.
@@ -1,15 +0,0 @@
1
- ---
2
- name: babysitter:status
3
- description: Check the status of the active babysitter run
4
- arguments:
5
- - name: runId
6
- description: Optional run ID to check (defaults to the active run)
7
- required: false
8
- ---
9
-
10
- Check the current status of a babysitter orchestration run.
11
-
12
- ## Notes
13
-
14
- - When called without arguments, reports on the run bound to the current session.
15
- - If discovery reports `oh-my-pi` as installed but direct invocation fails, validate `where omp`.
@@ -1,95 +0,0 @@
1
- /**
2
- * Babysitter CLI invocation helper.
3
- *
4
- * Spawns the `babysitter` CLI as a child process, captures stdout/stderr,
5
- * parses JSON output, and surfaces structured errors. Every other module
6
- * that needs to talk to babysitter goes through here so there is exactly
7
- * one place to handle timeouts, env vars, and error mapping.
8
- *
9
- * @deprecated Use `sdk-bridge.ts` instead. This module spawns a child
10
- * process to communicate with babysitter. The SDK bridge imports the
11
- * runtime directly, avoiding subprocess overhead and JSON parsing.
12
- * This file is retained only for backward compatibility and will be
13
- * removed in a future release.
14
- *
15
- * @module cli-wrapper
16
- */
17
-
18
- import { execFile } from 'node:child_process';
19
- import { CLI_COMMAND, CLI_TIMEOUT_MS } from './constants';
20
-
21
- /** Structured result from a CLI invocation. */
22
- export interface CliResult<T = unknown> {
23
- /** Whether the process exited with code 0. */
24
- success: boolean;
25
- /** Parsed JSON from stdout (when `--json` flag is used). */
26
- data?: T;
27
- /** Raw stdout string. */
28
- stdout: string;
29
- /** Raw stderr string. */
30
- stderr: string;
31
- /** Process exit code (null when killed by signal). */
32
- exitCode: number | null;
33
- }
34
-
35
- /**
36
- * Invoke the babysitter CLI with the given command and arguments.
37
- *
38
- * The `--json` flag is appended automatically so callers always get
39
- * machine-readable output. Errors are captured rather than thrown --
40
- * inspect `CliResult.success` to decide how to proceed.
41
- *
42
- * @param command - The babysitter sub-command (e.g. `"run:iterate"`).
43
- * @param args - Additional positional / flag arguments.
44
- * @param options - Optional overrides for timeout and env.
45
- * @returns A promise that resolves to the structured CLI result.
46
- *
47
- * @example
48
- * ```ts
49
- * const res = await runCli('run:iterate', ['--run-id', runId]);
50
- * if (res.success && res.data) {
51
- * console.log(res.data);
52
- * }
53
- * ```
54
- */
55
- export async function runCli<T = unknown>(
56
- command: string,
57
- args: string[] = [],
58
- options: { timeoutMs?: number; env?: Record<string, string> } = {},
59
- ): Promise<CliResult<T>> {
60
- const timeout = options.timeoutMs ?? CLI_TIMEOUT_MS;
61
- const fullArgs = [command, '--json', ...args];
62
-
63
- return new Promise<CliResult<T>>((resolve) => {
64
- const child = execFile(
65
- CLI_COMMAND,
66
- fullArgs,
67
- {
68
- timeout,
69
- maxBuffer: 10 * 1024 * 1024, // 10 MiB
70
- env: { ...process.env, ...options.env },
71
- },
72
- (error, stdout, stderr) => {
73
- const exitCode =
74
- error && 'code' in error ? (error.code as number | null) : child.exitCode;
75
-
76
- let data: T | undefined;
77
- try {
78
- if (stdout.trim()) {
79
- data = JSON.parse(stdout) as T;
80
- }
81
- } catch {
82
- // stdout was not valid JSON -- leave data undefined
83
- }
84
-
85
- resolve({
86
- success: exitCode === 0,
87
- data,
88
- stdout: String(stdout),
89
- stderr: String(stderr),
90
- exitCode: typeof exitCode === 'number' ? exitCode : null,
91
- });
92
- },
93
- );
94
- });
95
- }
@@ -1,77 +0,0 @@
1
- /**
2
- * Configuration constants for the babysitter oh-my-pi extension.
3
- *
4
- * Centralises magic strings, default timeouts, environment variable names,
5
- * and widget keys so the rest of the extension can remain blissfully ignorant
6
- * of where these values come from.
7
- *
8
- * @module constants
9
- */
10
-
11
- // ---------------------------------------------------------------------------
12
- // CLI
13
- // ---------------------------------------------------------------------------
14
-
15
- /** Path (or bare command name) used to invoke the babysitter CLI. */
16
- export const CLI_COMMAND = process.env['BABYSITTER_CLI_PATH'] ?? 'babysitter';
17
-
18
- /** Default timeout (ms) applied to every CLI invocation. */
19
- export const CLI_TIMEOUT_MS = 120_000;
20
-
21
- // ---------------------------------------------------------------------------
22
- // Orchestration limits (mirrors BABYSITTER_MAX_ITERATIONS etc.)
23
- // ---------------------------------------------------------------------------
24
-
25
- /** Default maximum orchestration iterations per run. */
26
- export const DEFAULT_MAX_ITERATIONS = 256;
27
-
28
- /** Default maximum wall-clock time (ms) for a single run. */
29
- export const DEFAULT_MAX_DURATION_MS = 30 * 60 * 1_000; // 30 minutes
30
-
31
- /** Consecutive errors before the guard trips. */
32
- export const DEFAULT_ERROR_THRESHOLD = 5;
33
-
34
- /** Number of identical iteration digests that signal a doom loop. */
35
- export const DEFAULT_DOOM_LOOP_WINDOW = 4;
36
-
37
- // ---------------------------------------------------------------------------
38
- // Timeouts
39
- // ---------------------------------------------------------------------------
40
-
41
- /** Timeout (ms) for a single effect execution. */
42
- export const EFFECT_TIMEOUT_MS = 900_000; // 15 minutes, matches NODE_TASK_TIMEOUT
43
-
44
- /** Timeout (ms) for posting a task result back. */
45
- export const POST_RESULT_TIMEOUT_MS = 30_000;
46
-
47
- /** Delay (ms) for a sleep effect (placeholder; real value comes from the effect). */
48
- export const DEFAULT_SLEEP_MS = 5_000;
49
-
50
- // ---------------------------------------------------------------------------
51
- // Environment variable names
52
- // ---------------------------------------------------------------------------
53
-
54
- export const ENV_RUNS_DIR = 'BABYSITTER_RUNS_DIR';
55
- export const ENV_MAX_ITERATIONS = 'BABYSITTER_MAX_ITERATIONS';
56
- export const ENV_QUALITY_THRESHOLD = 'BABYSITTER_QUALITY_THRESHOLD';
57
- export const ENV_TIMEOUT = 'BABYSITTER_TIMEOUT';
58
- export const ENV_LOG_LEVEL = 'BABYSITTER_LOG_LEVEL';
59
- export const ENV_HOOK_TIMEOUT = 'BABYSITTER_HOOK_TIMEOUT';
60
- export const ENV_NODE_TASK_TIMEOUT = 'BABYSITTER_NODE_TASK_TIMEOUT';
61
- export const ENV_CLI_PATH = 'BABYSITTER_CLI_PATH';
62
-
63
- // ---------------------------------------------------------------------------
64
- // Widget keys (for registerMessageRenderer / TUI identification)
65
- // ---------------------------------------------------------------------------
66
-
67
- export const WIDGET_RUN_PROGRESS = 'babysitter:run-progress';
68
- export const WIDGET_TASK_STATUS = 'babysitter:task-status';
69
- export const WIDGET_QUALITY_SCORE = 'babysitter:quality-score';
70
- export const WIDGET_PHASE_INDICATOR = 'babysitter:phase-indicator';
71
-
72
- // ---------------------------------------------------------------------------
73
- // Extension metadata
74
- // ---------------------------------------------------------------------------
75
-
76
- export const EXTENSION_NAME = 'babysitter';
77
- export const EXTENSION_VERSION = '0.1.0';