create-agentuity 3.0.3 → 3.0.5

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 CHANGED
@@ -5,16 +5,19 @@ launcher that delegates to `@agentuity/cli`'s `project create` flow.
5
5
 
6
6
  ## Usage
7
7
 
8
+ Use whichever package manager you already have — the launcher dispatches the
9
+ underlying CLI through the same one (npm/pnpm/yarn/bun), so Bun is not required.
10
+
8
11
  ```bash
9
- bun create agentuity my-project
12
+ npm create agentuity@latest my-project
10
13
  cd my-project
11
- bun run dev
14
+ npm run dev
12
15
  ```
13
16
 
14
- Or with npm:
15
-
16
17
  ```bash
17
- npm create agentuity@latest my-project
18
+ pnpm create agentuity my-project
19
+ yarn create agentuity my-project
20
+ bun create agentuity my-project
18
21
  ```
19
22
 
20
23
  ## What you get
@@ -43,8 +46,8 @@ The exact scripts depend on the framework you pick (the official CLI's own
43
46
  defaults are preserved). Every project gets at least:
44
47
 
45
48
  ```bash
46
- bun run dev # Run the framework's dev server with AI Gateway env
47
- bun run build # Framework build
49
+ npm run dev # Run the framework's dev server with AI Gateway env
50
+ npm run build # Framework build
48
51
  agentuity deploy # Deploy to Agentuity Cloud
49
52
  ```
50
53
 
package/dist/bin.js CHANGED
@@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process';
3
3
  import { realpathSync, readFileSync } from 'node:fs';
4
4
  import { dirname, resolve } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
- import { getCliVersionSpecifier } from "./index.js";
6
+ import { detectPackageManager, getCliVersionSpecifier, getCreateCommand } from "./index.js";
7
7
  // Read our own package.json to get the version. dist/bin.js lives alongside
8
8
  // dist/index.js; the published package.json is one level up from dist/.
9
9
  const here = dirname(fileURLToPath(import.meta.url));
@@ -32,8 +32,11 @@ function checkIsMain() {
32
32
  if (checkIsMain()) {
33
33
  const cliVersion = getCliVersionSpecifier(pkg.version);
34
34
  const args = process.argv.slice(2);
35
- const result = spawnSync('bunx', [`@agentuity/cli@${cliVersion}`, 'create', ...args], {
35
+ const pm = detectPackageManager(process.env.npm_config_user_agent);
36
+ const { command, args: commandArgs } = getCreateCommand(pm, `@agentuity/cli@${cliVersion}`, args);
37
+ const result = spawnSync(command, commandArgs, {
36
38
  stdio: 'inherit',
39
+ shell: process.platform === 'win32',
37
40
  });
38
41
  process.exit(result.status ?? 0);
39
42
  }
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,4EAA4E;AAC5E,wEAAwE;AACxE,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AACxD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAwB,CAAC;AAEjF;;;;;;;GAOG;AACH,SAAS,WAAW;IACnB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC;IAChC,CAAC;IACD,IAAI,CAAC;QACJ,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAA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;AAEjF;;;;;;;GAOG;AACH,SAAS,WAAW;IACnB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC;IAChC,CAAC;IACD,IAAI,CAAC;QACJ,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,UAAU,CAAC;IAC3D,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC;IACvC,CAAC;AACF,CAAC;AAED,IAAI,WAAW,EAAE,EAAE,CAAC;IACnB,MAAM,UAAU,GAAG,sBAAsB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACnE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,gBAAgB,CACtD,EAAE,EACF,kBAAkB,UAAU,EAAE,EAC9B,IAAI,CACJ,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE;QAC9C,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;KACnC,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AAClC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,4 +15,40 @@
15
15
  * so that `bun create agentuity@2.0.2` pins to that specific CLI version.
16
16
  */
17
17
  export declare function getCliVersionSpecifier(version: string): string;
18
+ /** Package managers we know how to dispatch a one-off package execution through. */
19
+ /**
20
+ * Package managers we know how to dispatch a one-off package execution
21
+ * through. Yarn is split because Classic (1.x) has no `dlx` command, so it
22
+ * must fall back to `npx`, while Berry (2+) uses `yarn dlx`.
23
+ */
24
+ export type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn' | 'yarn-classic';
25
+ /**
26
+ * Identify the package manager that invoked us from `npm_config_user_agent`.
27
+ *
28
+ * Every supported package manager sets this env var when running
29
+ * `<pm> create agentuity` / `<pm> dlx` / `npx`, in the form
30
+ * `name/version node/version ...` (e.g. `pnpm/8.15.4 npm/? node/v20.11.1`).
31
+ * Yarn 1.x is reported as `yarn-classic` because it lacks `yarn dlx`.
32
+ * Returns `undefined` when the var is absent or unrecognized, so callers
33
+ * can fall back to a safe default.
34
+ */
35
+ export declare function detectPackageManager(userAgent: string | undefined): PackageManager | undefined;
36
+ /**
37
+ * Build the command + args that run `@agentuity/cli@<version> create ...`
38
+ * through the given package manager's one-off execution tool.
39
+ *
40
+ * bun → bunx @agentuity/cli@<v> create ...
41
+ * pnpm → pnpm dlx @agentuity/cli@<v> create ...
42
+ * yarn (Berry) → yarn dlx @agentuity/cli@<v> create ...
43
+ * npm / yarn 1.x → npx --yes @agentuity/cli@<v> create ...
44
+ *
45
+ * Defaults to `npx` when the package manager is unknown (or is Yarn Classic,
46
+ * which has no `dlx`), because the wrapper runs under `#!/usr/bin/env node`,
47
+ * so Node (and therefore npx) is guaranteed to be present even when Bun is
48
+ * not installed.
49
+ */
50
+ export declare function getCreateCommand(pm: PackageManager | undefined, cliPackage: string, args: string[]): {
51
+ command: string;
52
+ args: string[];
53
+ };
18
54
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ9D;AAED,oFAAoF;AACpF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;AAE9E;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAiB9F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC/B,EAAE,EAAE,cAAc,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAYrC"}
package/dist/index.js CHANGED
@@ -23,4 +23,60 @@ export function getCliVersionSpecifier(version) {
23
23
  // Stable versions: use the exact version to ensure major version compatibility
24
24
  return version;
25
25
  }
26
+ /**
27
+ * Identify the package manager that invoked us from `npm_config_user_agent`.
28
+ *
29
+ * Every supported package manager sets this env var when running
30
+ * `<pm> create agentuity` / `<pm> dlx` / `npx`, in the form
31
+ * `name/version node/version ...` (e.g. `pnpm/8.15.4 npm/? node/v20.11.1`).
32
+ * Yarn 1.x is reported as `yarn-classic` because it lacks `yarn dlx`.
33
+ * Returns `undefined` when the var is absent or unrecognized, so callers
34
+ * can fall back to a safe default.
35
+ */
36
+ export function detectPackageManager(userAgent) {
37
+ if (!userAgent)
38
+ return undefined;
39
+ const [name, version] = userAgent.split(' ')[0]?.split('/') ?? [];
40
+ switch (name?.toLowerCase()) {
41
+ case 'bun':
42
+ return 'bun';
43
+ case 'npm':
44
+ return 'npm';
45
+ case 'pnpm':
46
+ return 'pnpm';
47
+ case 'yarn':
48
+ // Yarn Classic (1.x) has no `dlx`; treat it separately so we can
49
+ // route it through npx instead.
50
+ return version?.startsWith('1.') ? 'yarn-classic' : 'yarn';
51
+ default:
52
+ return undefined;
53
+ }
54
+ }
55
+ /**
56
+ * Build the command + args that run `@agentuity/cli@<version> create ...`
57
+ * through the given package manager's one-off execution tool.
58
+ *
59
+ * bun → bunx @agentuity/cli@<v> create ...
60
+ * pnpm → pnpm dlx @agentuity/cli@<v> create ...
61
+ * yarn (Berry) → yarn dlx @agentuity/cli@<v> create ...
62
+ * npm / yarn 1.x → npx --yes @agentuity/cli@<v> create ...
63
+ *
64
+ * Defaults to `npx` when the package manager is unknown (or is Yarn Classic,
65
+ * which has no `dlx`), because the wrapper runs under `#!/usr/bin/env node`,
66
+ * so Node (and therefore npx) is guaranteed to be present even when Bun is
67
+ * not installed.
68
+ */
69
+ export function getCreateCommand(pm, cliPackage, args) {
70
+ const create = [cliPackage, 'create', ...args];
71
+ switch (pm) {
72
+ case 'bun':
73
+ return { command: 'bunx', args: create };
74
+ case 'pnpm':
75
+ return { command: 'pnpm', args: ['dlx', ...create] };
76
+ case 'yarn':
77
+ return { command: 'yarn', args: ['dlx', ...create] };
78
+ default:
79
+ return { command: 'npx', args: ['--yes', ...create] };
80
+ }
81
+ }
26
82
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe;IACrD,6DAA6D;IAC7D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,+EAA+E;IAC/E,OAAO,OAAO,CAAC;AAChB,CAAC"}
1
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AK;YACT,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC1C,KAAK,MAAM;YACV,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACtD,KAAK,MAAM;YACV,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACtD;YACC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACxD,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agentuity",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Agentuity employees and contributors",
6
6
  "description": "Create a new Agentuity project",