@a5c-ai/babysitter-sdk 6.0.1-staging.ffc4f312f8c0 → 6.0.2
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/dist/cli/adaptersBin.d.ts +3 -0
- package/dist/cli/adaptersBin.d.ts.map +1 -0
- package/dist/cli/adaptersBin.js +18 -0
- package/dist/cli/adaptersHooksBin.d.ts +3 -0
- package/dist/cli/adaptersHooksBin.d.ts.map +1 -0
- package/dist/cli/adaptersHooksBin.js +23 -0
- package/dist/cli/resolveDependencyBin.d.ts +12 -0
- package/dist/cli/resolveDependencyBin.d.ts.map +1 -0
- package/dist/cli/resolveDependencyBin.js +32 -0
- package/package.json +9 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptersBin.d.ts","sourceRoot":"","sources":["../../src/cli/adaptersBin.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/**
|
|
5
|
+
* babysitter-sdk bin shim for `adapters`.
|
|
6
|
+
*
|
|
7
|
+
* Exposes the @a5c-ai/adapters CLI on PATH after `npm i -g @a5c-ai/babysitter-sdk`
|
|
8
|
+
* (see adaptersHooksBin.ts for why a plain dependency is not enough). Some plugin
|
|
9
|
+
* surfaces and doctor checks call the bare `adapters` binary; re-export it here so
|
|
10
|
+
* users no longer have to install @a5c-ai/adapters separately.
|
|
11
|
+
*/
|
|
12
|
+
const node_child_process_1 = require("node:child_process");
|
|
13
|
+
const resolveDependencyBin_1 = require("./resolveDependencyBin");
|
|
14
|
+
const entry = (0, resolveDependencyBin_1.resolveDependencyBin)('@a5c-ai/adapters', 'adapters');
|
|
15
|
+
const result = (0, node_child_process_1.spawnSync)(process.execPath, [entry, ...process.argv.slice(2)], {
|
|
16
|
+
stdio: 'inherit',
|
|
17
|
+
});
|
|
18
|
+
process.exit(result.status ?? 1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptersHooksBin.d.ts","sourceRoot":"","sources":["../../src/cli/adaptersHooksBin.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/**
|
|
5
|
+
* babysitter-sdk bin shim for `adapters-hooks`.
|
|
6
|
+
*
|
|
7
|
+
* The generated harness plugins (e.g. babysitter-claude) write a hooks.json that
|
|
8
|
+
* invokes the bare `adapters-hooks` binary (from @a5c-ai/hooks-adapter-cli) for
|
|
9
|
+
* every hook event, so that binary must be on PATH wherever the plugin runs.
|
|
10
|
+
* Plugins bootstrap by running `npm i -g @a5c-ai/babysitter-sdk`, but npm only
|
|
11
|
+
* links a package's OWN bins to the global bin dir — never its dependencies' — so
|
|
12
|
+
* a plain dependency on @a5c-ai/hooks-adapter-cli is not enough. Re-exporting it
|
|
13
|
+
* as a babysitter-sdk bin guarantees `adapters-hooks` lands on PATH alongside
|
|
14
|
+
* `babysitter`. We re-exec the dependency's real CLI entry as a child node
|
|
15
|
+
* process so it runs exactly as if invoked directly.
|
|
16
|
+
*/
|
|
17
|
+
const node_child_process_1 = require("node:child_process");
|
|
18
|
+
const resolveDependencyBin_1 = require("./resolveDependencyBin");
|
|
19
|
+
const entry = (0, resolveDependencyBin_1.resolveDependencyBin)('@a5c-ai/hooks-adapter-cli', 'adapters-hooks');
|
|
20
|
+
const result = (0, node_child_process_1.spawnSync)(process.execPath, [entry, ...process.argv.slice(2)], {
|
|
21
|
+
stdio: 'inherit',
|
|
22
|
+
});
|
|
23
|
+
process.exit(result.status ?? 1);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the absolute path to a dependency package's declared bin entry.
|
|
3
|
+
*
|
|
4
|
+
* Locates the package directory by scanning the node_modules resolution paths and
|
|
5
|
+
* reading its `package.json` with `fs` directly. This deliberately avoids
|
|
6
|
+
* `require.resolve('<pkg>/package.json')` (blocked by a restrictive `exports` map,
|
|
7
|
+
* e.g. @a5c-ai/adapters) and `require.resolve('<pkg>')` (fails for bin-only
|
|
8
|
+
* packages with no `main`, e.g. @a5c-ai/hooks-adapter-cli). Used by the
|
|
9
|
+
* babysitter-sdk bin shims that re-expose dependency CLIs on PATH.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveDependencyBin(packageName: string, binName: string): string;
|
|
12
|
+
//# sourceMappingURL=resolveDependencyBin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDependencyBin.d.ts","sourceRoot":"","sources":["../../src/cli/resolveDependencyBin.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAiBjF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveDependencyBin = resolveDependencyBin;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the absolute path to a dependency package's declared bin entry.
|
|
8
|
+
*
|
|
9
|
+
* Locates the package directory by scanning the node_modules resolution paths and
|
|
10
|
+
* reading its `package.json` with `fs` directly. This deliberately avoids
|
|
11
|
+
* `require.resolve('<pkg>/package.json')` (blocked by a restrictive `exports` map,
|
|
12
|
+
* e.g. @a5c-ai/adapters) and `require.resolve('<pkg>')` (fails for bin-only
|
|
13
|
+
* packages with no `main`, e.g. @a5c-ai/hooks-adapter-cli). Used by the
|
|
14
|
+
* babysitter-sdk bin shims that re-expose dependency CLIs on PATH.
|
|
15
|
+
*/
|
|
16
|
+
function resolveDependencyBin(packageName, binName) {
|
|
17
|
+
const searchPaths = require.resolve.paths(packageName) ?? [];
|
|
18
|
+
for (const base of searchPaths) {
|
|
19
|
+
const packageDir = (0, node_path_1.join)(base, ...packageName.split('/'));
|
|
20
|
+
const manifestPath = (0, node_path_1.join)(packageDir, 'package.json');
|
|
21
|
+
if (!(0, node_fs_1.existsSync)(manifestPath)) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const manifest = JSON.parse((0, node_fs_1.readFileSync)(manifestPath, 'utf8'));
|
|
25
|
+
const binValue = typeof manifest.bin === 'string' ? manifest.bin : manifest.bin?.[binName];
|
|
26
|
+
if (!binValue) {
|
|
27
|
+
throw new Error(`${packageName} does not declare a "${binName}" bin`);
|
|
28
|
+
}
|
|
29
|
+
return (0, node_path_1.join)(packageDir, binValue);
|
|
30
|
+
}
|
|
31
|
+
throw new Error(`Unable to locate ${packageName} in node_modules`);
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-sdk",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "Storage and run-registry primitives for event-sourced babysitter workflows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"babysitter-sdk": "dist/cli/main.js",
|
|
11
11
|
"babysitter": "dist/cli/main.js",
|
|
12
|
-
"babysitter-mcp-server": "dist/cli/mcpServeEntry.js"
|
|
12
|
+
"babysitter-mcp-server": "dist/cli/mcpServeEntry.js",
|
|
13
|
+
"adapters-hooks": "dist/cli/adaptersHooksBin.js",
|
|
14
|
+
"adapters": "dist/cli/adaptersBin.js"
|
|
13
15
|
},
|
|
14
16
|
"files": [
|
|
15
17
|
"dist",
|
|
@@ -40,8 +42,9 @@
|
|
|
40
42
|
"verify:package-health": "node scripts/verify-package-health.cjs"
|
|
41
43
|
},
|
|
42
44
|
"dependencies": {
|
|
43
|
-
"@a5c-ai/atlas": "6.0.
|
|
44
|
-
"@a5c-ai/adapters": "6.0.
|
|
45
|
+
"@a5c-ai/atlas": "6.0.2",
|
|
46
|
+
"@a5c-ai/adapters": "6.0.2",
|
|
47
|
+
"@a5c-ai/hooks-adapter-cli": "6.0.2",
|
|
45
48
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
46
49
|
"@sinclair/typebox": "^0.34.48",
|
|
47
50
|
"fs-extra": "^11.2.0",
|
|
@@ -54,7 +57,7 @@
|
|
|
54
57
|
"puppeteer": "^24.0.0"
|
|
55
58
|
},
|
|
56
59
|
"peerDependencies": {
|
|
57
|
-
"@a5c-ai/tasks-adapter": "6.0.
|
|
60
|
+
"@a5c-ai/tasks-adapter": "6.0.2"
|
|
58
61
|
},
|
|
59
62
|
"peerDependenciesMeta": {
|
|
60
63
|
"@a5c-ai/tasks-adapter": {
|
|
@@ -62,7 +65,7 @@
|
|
|
62
65
|
}
|
|
63
66
|
},
|
|
64
67
|
"devDependencies": {
|
|
65
|
-
"@a5c-ai/tasks-adapter": "6.0.
|
|
68
|
+
"@a5c-ai/tasks-adapter": "6.0.2",
|
|
66
69
|
"@eslint/js": "^9.39.4",
|
|
67
70
|
"@types/fs-extra": "^11.0.4",
|
|
68
71
|
"@types/node": "^20.11.30",
|