@castlekit/castle 0.1.4 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/bin/castle.js +22 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -28,6 +28,22 @@ npm run dev
28
28
 
29
29
  Then open [http://localhost:3333](http://localhost:3333).
30
30
 
31
+ ## Releasing
32
+
33
+ ```bash
34
+ # 1. Bump version
35
+ npm version patch --no-git-tag-version
36
+
37
+ # 2. Commit and push
38
+ git add -A && git commit -m "Release vX.Y.Z" && git push
39
+
40
+ # 3. Publish to npm (requires 2FA)
41
+ npm publish --access public
42
+
43
+ # 4. Tag the release
44
+ git tag vX.Y.Z && git push origin vX.Y.Z
45
+ ```
46
+
31
47
  ## Requirements
32
48
 
33
49
  - Node.js >= 22
package/bin/castle.js CHANGED
@@ -1,15 +1,32 @@
1
- #!/usr/bin/env -S node --import tsx
1
+ #!/usr/bin/env node
2
2
 
3
3
  // Castle CLI - The multi-agent workspace
4
4
  // https://castlekit.com
5
5
 
6
- import { program } from "commander";
7
- import pc from "picocolors";
8
- import { readFileSync } from "fs";
9
- import { resolve, dirname } from "path";
6
+ // Bootstrap tsx from the package's own node_modules so it works
7
+ // regardless of the user's current working directory.
8
+ import { dirname, resolve } from "path";
10
9
  import { fileURLToPath } from "url";
11
10
 
12
11
  const __dirname = dirname(fileURLToPath(import.meta.url));
12
+
13
+ if (!process.env._CASTLE_CLI) {
14
+ const { execFileSync } = await import("child_process");
15
+ const tsxImport = resolve(__dirname, "..", "node_modules", "tsx", "dist", "esm", "index.mjs");
16
+ try {
17
+ execFileSync(process.execPath, ["--import", tsxImport, ...process.argv.slice(1)], {
18
+ stdio: "inherit",
19
+ env: { ...process.env, _CASTLE_CLI: "1" },
20
+ });
21
+ } catch (e) {
22
+ process.exit(e.status || 1);
23
+ }
24
+ process.exit(0);
25
+ }
26
+
27
+ const { program } = await import("commander");
28
+ const pc = (await import("picocolors")).default;
29
+ const { readFileSync } = await import("fs");
13
30
  let version = "0.0.0";
14
31
  try {
15
32
  version = JSON.parse(readFileSync(resolve(__dirname, "..", "package.json"), "utf-8")).version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@castlekit/castle",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "The multi-agent workspace",
5
5
  "type": "module",
6
6
  "bin": {