@meowlynxsea/koi 0.1.2 → 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.
- package/bin/koi +21 -6
- package/dist/main.js +580 -250
- package/package.json +2 -1
- package/src/agent/mode.ts +1 -0
- package/src/agent/monitor-registry.ts +186 -117
- package/src/agent/session-store.ts +1 -1
- package/src/services/mcp/types.ts +1 -0
- package/src/skills/bundled/batch.ts +1 -1
- package/src/skills/bundled/debug.ts +1 -1
- package/src/tools/bash.ts +174 -66
- package/src/tools/index.ts +2 -0
- package/src/tools/pty.ts +285 -0
- package/src/tools/send-to-monitor.ts +158 -0
- package/src/tui/components/connecting-modal.tsx +2 -1
- package/src/tui/components/side-bar.tsx +1 -1
package/bin/koi
CHANGED
|
@@ -5,16 +5,31 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Deeply customized coding agent built on top of Pi SDK.
|
|
7
7
|
* TUI + Bun runtime.
|
|
8
|
+
*
|
|
9
|
+
* Locates the package by walking up directories from this script
|
|
10
|
+
* until we find dist/main.js. This works for both local dev and global install.
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
|
-
import {
|
|
13
|
+
import { existsSync } from "fs";
|
|
14
|
+
import { dirname, join } from "path";
|
|
11
15
|
import { fileURLToPath } from "url";
|
|
12
16
|
|
|
13
|
-
//
|
|
14
|
-
const
|
|
15
|
-
const projectRoot = resolve(__dirname, "..");
|
|
16
|
-
process.chdir(projectRoot);
|
|
17
|
+
// Get the directory where this script actually lives
|
|
18
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
// Walk up directories until we find dist/main.js
|
|
21
|
+
// In dev: scriptDir = .../koi/bin, packageRoot = .../koi
|
|
22
|
+
// In global install: scriptDir = .../node_modules/.bin, packageRoot = .../node_modules/@meowlynxsea/koi
|
|
23
|
+
let packageRoot = scriptDir;
|
|
24
|
+
while (!existsSync(join(packageRoot, "dist/main.js"))) {
|
|
25
|
+
const parent = dirname(packageRoot);
|
|
26
|
+
if (parent === packageRoot) {
|
|
27
|
+
console.error("Could not find koi package");
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
packageRoot = parent;
|
|
31
|
+
}
|
|
19
32
|
|
|
33
|
+
// Import and run main
|
|
34
|
+
const { main } = await import(join(packageRoot, "dist/main.js"));
|
|
20
35
|
await main();
|