@a5c-ai/babysitter-opencode 5.0.1-staging.b5c14f2a → 5.0.1-staging.ca65e187
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.
- package/README.md +2 -2
- package/bin/cli.cjs +1 -191
- package/bin/cli.js +90 -49
- package/bin/install-shared.cjs +1 -478
- package/bin/install-shared.js +615 -0
- package/bin/install.cjs +1 -143
- package/bin/install.js +18 -98
- package/bin/uninstall.cjs +1 -87
- package/bin/uninstall.js +12 -34
- package/commands/doctor.md +5 -5
- package/commands/help.md +245 -244
- package/commands/observe.md +12 -12
- package/hooks/babysitter-proxied-session-created.js +24 -0
- package/hooks/babysitter-proxied-session-created.sh +11 -0
- package/hooks/babysitter-proxied-session-idle.js +24 -0
- package/hooks/babysitter-proxied-session-idle.sh +3 -0
- package/hooks/babysitter-proxied-shell-env.js +24 -0
- package/hooks/babysitter-proxied-shell-env.sh +3 -0
- package/hooks/babysitter-proxied-tool-execute-after.js +24 -0
- package/hooks/babysitter-proxied-tool-execute-after.sh +3 -0
- package/hooks/babysitter-proxied-tool-execute-before.js +24 -0
- package/hooks/babysitter-proxied-tool-execute-before.sh +3 -0
- package/hooks/hooks.json +18 -18
- package/package.json +22 -18
- package/plugin.json +6 -4
- package/scripts/team-install.js +23 -0
- package/skills/contrib/SKILL.md +25 -25
- package/skills/doctor/SKILL.md +5 -5
- package/skills/help/SKILL.md +3 -2
- package/skills/observe/SKILL.md +1 -1
- package/skills/plugins/SKILL.md +243 -243
- package/skills/project-install/SKILL.md +3 -3
- package/skills/resume/SKILL.md +1 -1
- package/skills/retrospect/SKILL.md +48 -48
- package/skills/user-install/SKILL.md +3 -3
- package/versions.json +2 -2
- package/hooks/session-created.js +0 -182
- package/hooks/session-idle.js +0 -124
- package/hooks/shell-env.js +0 -88
- package/hooks/tool-execute-after.js +0 -107
- package/hooks/tool-execute-before.js +0 -109
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var execSync = require("child_process").execSync;
|
|
4
|
+
var path = require("path");
|
|
5
|
+
var readFileSync = require("fs").readFileSync;
|
|
6
|
+
|
|
7
|
+
var PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.PLUGIN_ROOT || path.resolve(__dirname, "..");
|
|
8
|
+
var stdin = "";
|
|
9
|
+
try { stdin = readFileSync(0, "utf8"); } catch {}
|
|
10
|
+
try {
|
|
11
|
+
var result = execSync("bash " + JSON.stringify(path.join(PLUGIN_ROOT, "hooks/pre-tool-use.sh")), {
|
|
12
|
+
input: stdin,
|
|
13
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
14
|
+
timeout: 30000,
|
|
15
|
+
env: Object.assign({}, process.env, {
|
|
16
|
+
HOOK_TYPE: process.env.HOOK_TYPE || "",
|
|
17
|
+
ADAPTER_NAME: process.env.ADAPTER_NAME || "opencode",
|
|
18
|
+
PLUGIN_ROOT: PLUGIN_ROOT
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
process.stdout.write(result);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
process.stdout.write("{}\n");
|
|
24
|
+
}
|
package/hooks/hooks.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "babysitter hook registration for OpenCode.",
|
|
4
4
|
"hooks": {
|
|
5
5
|
"session.created": [
|
|
6
6
|
{
|
|
7
7
|
"type": "command",
|
|
8
|
-
"script": "hooks/session-created.js",
|
|
9
|
-
"description": "
|
|
8
|
+
"script": "./hooks/babysitter-proxied-session-created.js",
|
|
9
|
+
"description": "babysitter SessionStart hook",
|
|
10
10
|
"timeoutMs": 30000
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
|
-
"
|
|
13
|
+
"tool.execute.before": [
|
|
14
14
|
{
|
|
15
15
|
"type": "command",
|
|
16
|
-
"script": "hooks/
|
|
17
|
-
"description": "
|
|
16
|
+
"script": "./hooks/babysitter-proxied-tool-execute-before.js",
|
|
17
|
+
"description": "babysitter PreToolUse hook",
|
|
18
18
|
"timeoutMs": 30000
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
|
-
"
|
|
21
|
+
"tool.execute.after": [
|
|
22
22
|
{
|
|
23
23
|
"type": "command",
|
|
24
|
-
"script": "hooks/
|
|
25
|
-
"description": "
|
|
26
|
-
"timeoutMs":
|
|
24
|
+
"script": "./hooks/babysitter-proxied-tool-execute-after.js",
|
|
25
|
+
"description": "babysitter PostToolUse hook",
|
|
26
|
+
"timeoutMs": 30000
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
|
-
"
|
|
29
|
+
"session.idle": [
|
|
30
30
|
{
|
|
31
31
|
"type": "command",
|
|
32
|
-
"script": "hooks/
|
|
33
|
-
"description": "
|
|
34
|
-
"timeoutMs":
|
|
32
|
+
"script": "./hooks/babysitter-proxied-session-idle.js",
|
|
33
|
+
"description": "babysitter SessionIdle hook",
|
|
34
|
+
"timeoutMs": 30000
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"
|
|
37
|
+
"shell.env": [
|
|
38
38
|
{
|
|
39
39
|
"type": "command",
|
|
40
|
-
"script": "hooks/
|
|
41
|
-
"description": "
|
|
42
|
-
"timeoutMs":
|
|
40
|
+
"script": "./hooks/babysitter-proxied-shell-env.js",
|
|
41
|
+
"description": "babysitter ShellEnv hook",
|
|
42
|
+
"timeoutMs": 5000
|
|
43
43
|
}
|
|
44
44
|
]
|
|
45
45
|
}
|
package/package.json
CHANGED
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-opencode",
|
|
3
|
-
"version": "5.0.1-staging.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "5.0.1-staging.ca65e187",
|
|
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
|
-
"test": "node test/integration.test.js",
|
|
7
|
-
"test:integration": "node test/integration.test.js",
|
|
8
|
-
"sync:commands": "node scripts/sync-command-docs.cjs",
|
|
9
|
-
"postinstall": "node bin/install.cjs",
|
|
10
|
-
"preuninstall": "node bin/uninstall.cjs",
|
|
11
6
|
"deploy": "npm publish --access public",
|
|
12
|
-
"deploy:staging": "npm publish --access public --tag staging"
|
|
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 test/integration.test.js",
|
|
12
|
+
"sync:commands": "node scripts/sync-command-docs.cjs"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"babysitter-opencode": "bin/cli.
|
|
15
|
+
"babysitter-opencode": "bin/cli.js"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"bin/",
|
|
19
|
-
"commands/",
|
|
20
19
|
"hooks/",
|
|
21
|
-
"scripts/",
|
|
22
20
|
"skills/",
|
|
21
|
+
"commands/",
|
|
22
|
+
"scripts/",
|
|
23
23
|
"plugin.json",
|
|
24
|
-
"
|
|
24
|
+
"README.md",
|
|
25
|
+
"versions.json",
|
|
26
|
+
"package.json"
|
|
25
27
|
],
|
|
26
28
|
"keywords": [
|
|
27
29
|
"babysitter",
|
|
28
30
|
"opencode",
|
|
29
|
-
"orchestration"
|
|
30
|
-
"ai-agent",
|
|
31
|
-
"sdk-integration"
|
|
31
|
+
"orchestration"
|
|
32
32
|
],
|
|
33
33
|
"author": "a5c.ai",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@a5c-ai/babysitter-sdk": "5.0.1-staging.ca65e187"
|
|
40
|
+
},
|
|
38
41
|
"repository": {
|
|
39
42
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/a5c-ai/babysitter"
|
|
43
|
+
"url": "git+https://github.com/a5c-ai/babysitter.git",
|
|
44
|
+
"directory": "plugins/babysitter-opencode"
|
|
41
45
|
},
|
|
42
46
|
"homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-opencode#readme",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/a5c-ai/babysitter/issues"
|
|
45
49
|
}
|
|
46
50
|
}
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babysitter",
|
|
3
|
-
"version": "5.0.1-staging.
|
|
4
|
-
"description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval
|
|
3
|
+
"version": "5.0.1-staging.ca65e187",
|
|
4
|
+
"description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
|
|
5
5
|
"author": "a5c.ai",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"harness": "opencode",
|
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
"automation",
|
|
19
19
|
"event-sourced",
|
|
20
20
|
"hooks",
|
|
21
|
-
"
|
|
21
|
+
"TDD",
|
|
22
|
+
"quality-convergence",
|
|
22
23
|
"agent",
|
|
23
|
-
"LLM"
|
|
24
|
+
"LLM",
|
|
25
|
+
"opencode"
|
|
24
26
|
]
|
|
25
27
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var path = require('path');
|
|
5
|
+
var shared = require('../bin/install-shared');
|
|
6
|
+
|
|
7
|
+
var workspace = process.cwd();
|
|
8
|
+
for (var i = 0; i < process.argv.length; i++) {
|
|
9
|
+
if (process.argv[i] === '--workspace' && process.argv[i + 1]) {
|
|
10
|
+
workspace = path.resolve(process.argv[i + 1]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var src = process.env.PLUGIN_PACKAGE_ROOT || path.resolve(__dirname, '..');
|
|
15
|
+
var dest = shared.getHomePluginRoot('workspace');
|
|
16
|
+
console.log('[babysitter] Team install to ' + dest);
|
|
17
|
+
|
|
18
|
+
shared.copyPluginBundle(src, dest);
|
|
19
|
+
if (typeof shared.harnessTeamInstall === 'function') {
|
|
20
|
+
shared.harnessTeamInstall(src, dest, workspace);
|
|
21
|
+
}
|
|
22
|
+
shared.runPostInstall(dest);
|
|
23
|
+
console.log('[babysitter] Team install complete.');
|
package/skills/contrib/SKILL.md
CHANGED
|
@@ -5,30 +5,30 @@ description: Submit feedback or contribute to babysitter project
|
|
|
5
5
|
|
|
6
6
|
# contrib
|
|
7
7
|
|
|
8
|
-
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
|
|
9
|
-
|
|
10
|
-
## Process Routing
|
|
11
|
-
|
|
8
|
+
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
|
|
9
|
+
|
|
10
|
+
## Process Routing
|
|
11
|
+
|
|
12
12
|
Contribution processes live under the active process library's `cradle/` directory. Resolve the active library root with `babysitter process-library:active --json` and route based on arguments:
|
|
13
|
-
|
|
14
|
-
### Issue-based (opens a GitHub issue in a5c-ai/babysitter)
|
|
15
|
-
* **Bug report** → `cradle/bug-report.js#process` — Report a bug in the SDK, CLI, process library, etc.
|
|
16
|
-
* **Feature request** → `cradle/feature-request.js#process` — Request a new feature or enhancement
|
|
17
|
-
* **Documentation question** → `cradle/documentation-question.js#process` — Ask about undocumented behavior or missing docs
|
|
18
|
-
|
|
19
|
-
### PR-based (forks repo, creates branch, submits PR to a5c-ai/babysitter)
|
|
20
|
-
* **Bugfix** → `cradle/bugfix.js#process` — User already has the fix for a bug
|
|
21
|
-
* **Feature implementation** → `cradle/feature-implementation-contribute.js#process` — User already has a feature implementation
|
|
22
|
-
* **Harness integration** → `cradle/feature-harness-integration-contribute.js#process` — User has a harness (CI/CD, IDE, editor) integration
|
|
23
|
-
* **Library contribution** → `cradle/library-contribution.js#process` — New or improved process/skill/subagent for the library
|
|
24
|
-
* **Documentation answer** → `cradle/documentation-contribute-answer.js#process` — User has an answer for an unanswered docs question
|
|
25
|
-
|
|
26
|
-
### Router (when arguments are empty or general)
|
|
27
|
-
* **Contribute** → `cradle/contribute.js#process` — Explains contribution types and routes to the specific process
|
|
28
|
-
|
|
29
|
-
## Contribution Rules
|
|
30
|
-
|
|
31
|
-
* PR-based contributions: fork the babysitter repo (a5c-ai/babysitter) for the user, ask to star if not already starred, perform changes, submit PR
|
|
32
|
-
* Issue-based contributions: gather details, search for duplicates, review, then open an issue in a5c-ai/babysitter
|
|
33
|
-
* Add breakpoints (permissions) before ALL gh actions (fork, star, submit PR/issue) to allow user review and cancellation
|
|
13
|
+
|
|
14
|
+
### Issue-based (opens a GitHub issue in a5c-ai/babysitter)
|
|
15
|
+
* **Bug report** → `cradle/bug-report.js#process` — Report a bug in the SDK, CLI, process library, etc.
|
|
16
|
+
* **Feature request** → `cradle/feature-request.js#process` — Request a new feature or enhancement
|
|
17
|
+
* **Documentation question** → `cradle/documentation-question.js#process` — Ask about undocumented behavior or missing docs
|
|
18
|
+
|
|
19
|
+
### PR-based (forks repo, creates branch, submits PR to a5c-ai/babysitter)
|
|
20
|
+
* **Bugfix** → `cradle/bugfix.js#process` — User already has the fix for a bug
|
|
21
|
+
* **Feature implementation** → `cradle/feature-implementation-contribute.js#process` — User already has a feature implementation
|
|
22
|
+
* **Harness integration** → `cradle/feature-harness-integration-contribute.js#process` — User has a harness (CI/CD, IDE, editor) integration
|
|
23
|
+
* **Library contribution** → `cradle/library-contribution.js#process` — New or improved process/skill/subagent for the library
|
|
24
|
+
* **Documentation answer** → `cradle/documentation-contribute-answer.js#process` — User has an answer for an unanswered docs question
|
|
25
|
+
|
|
26
|
+
### Router (when arguments are empty or general)
|
|
27
|
+
* **Contribute** → `cradle/contribute.js#process` — Explains contribution types and routes to the specific process
|
|
28
|
+
|
|
29
|
+
## Contribution Rules
|
|
30
|
+
|
|
31
|
+
* PR-based contributions: fork the babysitter repo (a5c-ai/babysitter) for the user, ask to star if not already starred, perform changes, submit PR
|
|
32
|
+
* Issue-based contributions: gather details, search for duplicates, review, then open an issue in a5c-ai/babysitter
|
|
33
|
+
* Add breakpoints (permissions) before ALL gh actions (fork, star, submit PR/issue) to allow user review and cancellation
|
|
34
34
|
* If arguments are empty: use the `contribute.js` router process to show options and route accordingly
|
package/skills/doctor/SKILL.md
CHANGED
|
@@ -363,13 +363,13 @@ Mark as FAIL if:
|
|
|
363
363
|
- Parse the output and inspect the `resolvedFrom` field. Classify as follows:
|
|
364
364
|
- `resolvedFrom: "pid-marker"` → mark as PASS ("Session ID derives from the live Claude Code ancestor process -- authoritative").
|
|
365
365
|
- `resolvedFrom: "env-file"` → mark as PASS with a note ("CLAUDE_ENV_FILE was used; typically healthy").
|
|
366
|
-
- `resolvedFrom: "env-var"` → mark as WARN ("`
|
|
367
|
-
- Remediation: run `babysitter session:cleanup` and start a fresh Claude Code session, or `unset
|
|
366
|
+
- `resolvedFrom: "env-var"` → mark as WARN ("`AGENT_SESSION_ID` is set without a corroborating PID marker. Likely stale from a prior Claude Code session -- see GitHub issue #130").
|
|
367
|
+
- Remediation: run `babysitter session:cleanup` and start a fresh Claude Code session, or `unset AGENT_SESSION_ID` before invoking babysitter.
|
|
368
368
|
- `resolvedFrom: "none"` → mark as ERROR ("No session ID resolvable. Either no session-start hook fired, or the ancestor walk failed").
|
|
369
369
|
|
|
370
370
|
**Env-var shadow check:**
|
|
371
371
|
- Independently inspect `envVarPresent` and `envVarMatches` in the output.
|
|
372
|
-
- If `envVarPresent && !envVarMatches`, mark as WARN ("`
|
|
372
|
+
- If `envVarPresent && !envVarMatches`, mark as WARN ("`AGENT_SESSION_ID` in env does not match the resolved session ID; a stale value is shadowing the authoritative one. Unset the env var").
|
|
373
373
|
|
|
374
374
|
---
|
|
375
375
|
|
|
@@ -391,7 +391,7 @@ Mark as FAIL if:
|
|
|
391
391
|
|
|
392
392
|
- Enumerate files in `~/.a5c/` matching the pattern `current-session-*-pid-*`.
|
|
393
393
|
- Count markers per harness (derived from the filename).
|
|
394
|
-
- If more than one live marker exists for the same harness, mark as INFO ("Multiple live Claude Code / harness sessions detected; ensure each shell scopes `
|
|
394
|
+
- If more than one live marker exists for the same harness, mark as INFO ("Multiple live Claude Code / harness sessions detected; ensure each shell scopes `AGENT_SESSION_ID` appropriately -- the PID marker handles this automatically").
|
|
395
395
|
- Otherwise mark as PASS.
|
|
396
396
|
|
|
397
397
|
---
|
|
@@ -502,7 +502,7 @@ babysitter session:cleanup --dry-run # preview
|
|
|
502
502
|
babysitter session:cleanup # apply
|
|
503
503
|
|
|
504
504
|
# 2. Unset a stale env var
|
|
505
|
-
unset
|
|
505
|
+
unset AGENT_SESSION_ID
|
|
506
506
|
|
|
507
507
|
# 3. Re-bind a run explicitly if needed
|
|
508
508
|
babysitter session:resume --session-id <fresh-id> --state-dir ~/.a5c --run-id <runId> --runs-dir .a5c/runs
|
package/skills/help/SKILL.md
CHANGED
|
@@ -231,9 +231,10 @@ SECONDARY COMMANDS
|
|
|
231
231
|
effect status in your browser. Useful when running /yolo or /forever to watch
|
|
232
232
|
progress without interrupting the run.
|
|
233
233
|
|
|
234
|
-
How it works: Runs npx @
|
|
234
|
+
How it works: Runs npx @a5c-ai/babysitter-observer-dashboard@latest which watches
|
|
235
235
|
the .a5c/runs/ directory (or a parent directory containing multiple projects) and
|
|
236
|
-
serves a live dashboard. The process is blocking -- it runs until you stop it
|
|
236
|
+
serves a live dashboard. The process is blocking -- it runs until you stop it, and
|
|
237
|
+
it prints the local URL to share with the user.
|
|
237
238
|
|
|
238
239
|
Example: /babysitter:observe
|
|
239
240
|
(opens browser showing all runs with live-updating task
|
package/skills/observe/SKILL.md
CHANGED
|
@@ -10,4 +10,4 @@ Run the babysitter observer dashboard:
|
|
|
10
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
11
|
2. Launch the dashboard: `npx -y @a5c-ai/babysitter-observer-dashboard@latest --watch-dir <dir>`
|
|
12
12
|
3. This is a blocking process — it will keep running until stopped.
|
|
13
|
-
4.
|
|
13
|
+
4. Report the URL printed by the dashboard to the user, then open it in the browser.
|