pi-kot 0.1.1 → 0.1.3

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
@@ -1,4 +1,4 @@
1
- # pi-kot v0.1.1
1
+ # pi-kot v0.1.3
2
2
 
3
3
  Browser UI for the [pi coding agent](https://pi.dev).
4
4
  Self-hosted React workbench: streaming chat, session tree, file browser, terminal, git panel.
package/bin/pi-kot.mjs CHANGED
@@ -35,6 +35,7 @@
35
35
  import { readFileSync } from "node:fs";
36
36
  import { dirname, resolve } from "node:path";
37
37
  import { fileURLToPath, pathToFileURL } from "node:url";
38
+ import { homedir } from "node:os";
38
39
 
39
40
  const here = dirname(fileURLToPath(import.meta.url));
40
41
  const packageRoot = resolve(here, "..");
@@ -113,6 +114,16 @@ for (let i = 0; i < args.length; i++) {
113
114
  process.env.CLIENT_DIST_PATH ??= resolve(packageRoot, "dist", "client");
114
115
  process.env.NODE_ENV ??= "production";
115
116
 
117
+ // Auto-mount the current working directory as a project if it's not the
118
+ // workspace root itself. This makes `npx pi-kot` from any project folder
119
+ // show that folder in the project list automatically.
120
+ const cwd = process.cwd();
121
+ const defaultWorkspace = resolve(homedir(), ".pi-kot", "workspace", "default");
122
+ const workspacePath = resolve(process.env.WORKSPACE_PATH ?? defaultWorkspace);
123
+ if (cwd !== workspacePath) {
124
+ process.env.MOUNT_CWD_PROJECT = cwd;
125
+ }
126
+
116
127
  // Log startup info
117
128
  const port = process.env.PORT ?? "3333";
118
129
  const host = process.env.HOST ?? "0.0.0.0";