@a5c-ai/babysitter 5.0.1-staging.ff407b73 → 5.1.1-staging.00ceebd28cf2
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/__tests__/babysitter.test.js +53 -0
- package/bin/babysitter.js +23 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -33,8 +33,8 @@ For agent runtime orchestration commands such as `call`, `yolo`,
|
|
|
33
33
|
`invoke`, `resume`, `start-server`, and `tui`, install the optional agent CLI:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
npm install -g @a5c-ai/
|
|
37
|
-
|
|
36
|
+
npm install -g @a5c-ai/genty-platform
|
|
37
|
+
agent-platform --help-human
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## What's Included
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const fs = require("node:fs");
|
|
2
|
+
const os = require("node:os");
|
|
3
|
+
const path = require("node:path");
|
|
4
|
+
const assert = require("node:assert/strict");
|
|
5
|
+
const { spawnSync } = require("node:child_process");
|
|
6
|
+
const { afterEach, describe, it } = require("node:test");
|
|
7
|
+
|
|
8
|
+
const tmpDirs = [];
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
for (const dir of tmpDirs.splice(0)) {
|
|
12
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe("@a5c-ai/babysitter metapackage shim", () => {
|
|
17
|
+
it("prints actionable repair guidance when the SDK CLI module is missing", () => {
|
|
18
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "babysitter-shim-test-"));
|
|
19
|
+
tmpDirs.push(tmpDir);
|
|
20
|
+
const shimPath = path.join(tmpDir, "babysitter.js");
|
|
21
|
+
fs.writeFileSync(
|
|
22
|
+
path.join(tmpDir, "package.json"),
|
|
23
|
+
JSON.stringify({ type: "commonjs" }),
|
|
24
|
+
);
|
|
25
|
+
fs.copyFileSync(path.resolve(__dirname, "..", "babysitter.js"), shimPath);
|
|
26
|
+
|
|
27
|
+
fs.mkdirSync(
|
|
28
|
+
path.join(tmpDir, "node_modules", "@a5c-ai", "babysitter-sdk"),
|
|
29
|
+
{ recursive: true },
|
|
30
|
+
);
|
|
31
|
+
fs.writeFileSync(
|
|
32
|
+
path.join(tmpDir, "node_modules", "@a5c-ai", "babysitter-sdk", "package.json"),
|
|
33
|
+
JSON.stringify({ name: "@a5c-ai/babysitter-sdk", version: "0.0.0" }),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const result = spawnSync(process.execPath, [shimPath, "--version"], {
|
|
37
|
+
cwd: tmpDir,
|
|
38
|
+
encoding: "utf8",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
assert.equal(result.status, 1);
|
|
42
|
+
assert.match(result.stderr, /Unable to load @a5c-ai\/babysitter-sdk CLI/);
|
|
43
|
+
assert.match(result.stderr, /npm i -g @a5c-ai\/babysitter-sdk/);
|
|
44
|
+
assert.match(
|
|
45
|
+
result.stderr,
|
|
46
|
+
/npm exec --yes --package @a5c-ai\/babysitter-sdk@latest -- babysitter --version/,
|
|
47
|
+
);
|
|
48
|
+
assert.doesNotMatch(
|
|
49
|
+
result.stderr,
|
|
50
|
+
/node:internal\/modules\/cjs\/loader/,
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
});
|
package/bin/babysitter.js
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
|
|
4
4
|
// Alias to @a5c-ai/babysitter-sdk CLI
|
|
5
5
|
// This metapackage re-exports the babysitter CLI from the SDK package
|
|
6
|
-
|
|
6
|
+
let createBabysitterCli;
|
|
7
|
+
try {
|
|
8
|
+
({ createBabysitterCli } = require("@a5c-ai/babysitter-sdk/dist/cli/main.js"));
|
|
9
|
+
} catch (error) {
|
|
10
|
+
const missingSdkCli = error
|
|
11
|
+
&& error.code === "MODULE_NOT_FOUND"
|
|
12
|
+
&& String(error.message || "").includes("@a5c-ai/babysitter-sdk/dist/cli/main.js");
|
|
13
|
+
if (missingSdkCli) {
|
|
14
|
+
const version = process.env.BABYSITTER_SDK_VERSION || "latest";
|
|
15
|
+
console.error("Unable to load @a5c-ai/babysitter-sdk CLI.");
|
|
16
|
+
console.error("");
|
|
17
|
+
console.error("The global `babysitter` shim is installed, but its SDK CLI target is missing.");
|
|
18
|
+
console.error("Repair the global install, then validate it:");
|
|
19
|
+
console.error(` npm rm -g @a5c-ai/babysitter @a5c-ai/babysitter-sdk`);
|
|
20
|
+
console.error(` npm i -g @a5c-ai/babysitter-sdk@${version}`);
|
|
21
|
+
console.error(" babysitter --version");
|
|
22
|
+
console.error("");
|
|
23
|
+
console.error("Or bypass the global shim with the explicit SDK bin:");
|
|
24
|
+
console.error(` npm exec --yes --package @a5c-ai/babysitter-sdk@${version} -- babysitter --version`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
7
29
|
|
|
8
30
|
void createBabysitterCli().run();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.1-staging.00ceebd28cf2",
|
|
4
4
|
"description": "Metapackage for installing all babysitter npm packages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -15,11 +15,15 @@
|
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"lint": "eslint \"bin/**/*.js\" --max-warnings=0"
|
|
18
|
+
"lint": "eslint \"bin/**/*.js\" --max-warnings=0",
|
|
19
|
+
"test": "node --test bin/__tests__/*.test.js"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@a5c-ai/babysitter-sdk": "5.
|
|
22
|
-
"@a5c-ai/
|
|
22
|
+
"@a5c-ai/babysitter-sdk": "5.1.1-staging.00ceebd28cf2",
|
|
23
|
+
"@a5c-ai/genty-core": "5.1.1-staging.00ceebd28cf2",
|
|
24
|
+
"@a5c-ai/genty-runtime": "5.1.1-staging.00ceebd28cf2",
|
|
25
|
+
"@a5c-ai/genty-platform": "5.1.1-staging.00ceebd28cf2",
|
|
26
|
+
"@a5c-ai/genty": "5.1.1-staging.00ceebd28cf2"
|
|
23
27
|
},
|
|
24
28
|
"repository": {
|
|
25
29
|
"type": "git",
|