create-agentuity 1.0.61 → 1.0.63
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/bin.js +17 -1
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const pkg = require('./package.json');
|
|
7
|
+
|
|
8
|
+
// Determine the dist-tag based on create-agentuity version
|
|
9
|
+
// Prerelease versions (e.g., 2.0.0-beta.1) should use @next
|
|
10
|
+
// Stable versions should use @latest
|
|
11
|
+
function getDistTag(version) {
|
|
12
|
+
// Check for prerelease identifiers: alpha, beta, rc, canary, next, etc.
|
|
13
|
+
if (/-([a-zA-Z]+)/.test(version)) {
|
|
14
|
+
return 'next';
|
|
15
|
+
}
|
|
16
|
+
return 'latest';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const distTag = getDistTag(pkg.version);
|
|
4
20
|
const args = process.argv.slice(2);
|
|
5
|
-
const result = spawnSync('bunx', [
|
|
21
|
+
const result = spawnSync('bunx', [`@agentuity/cli@${distTag}`, 'create', ...args], {
|
|
6
22
|
stdio: 'inherit',
|
|
7
23
|
});
|
|
8
24
|
process.exit(result.status || 0);
|