@kybernesis/create 0.9.0 → 0.10.0

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/dist/cli.js CHANGED
@@ -19,6 +19,7 @@ import { bold, dim, red } from "./util.js";
19
19
  import { init } from "./init.js";
20
20
  import { doctor } from "./doctor.js";
21
21
  import { upgrade } from "./upgrade.js";
22
+ import { tui } from "./tui.js";
22
23
  import { installSkills } from "./skills.js";
23
24
  import { deploy } from "./deploy.js";
24
25
  import { register } from "./register.js";
@@ -70,6 +71,7 @@ const COMMANDS = {
70
71
  register: "Register this agent with the control plane (--name, --url).",
71
72
  deploy: "Deploy this agent to its host (--no-env to leave the env file alone).",
72
73
  upgrade: "Bring @kybernesis packages and eve to the certified versions (--skip-eval).",
74
+ tui: "Talk to your agents in the terminal.",
73
75
  version: "Print the version of this tool.",
74
76
  };
75
77
  /**
@@ -132,6 +134,9 @@ switch (command) {
132
134
  case "deploy":
133
135
  await deploy({ host: flag(rest, "host"), noEnv: rest.includes("--no-env") });
134
136
  break;
137
+ case "tui":
138
+ tui(rest);
139
+ break;
135
140
  case "upgrade":
136
141
  await upgrade(rest.includes("--skip-eval"));
137
142
  break;
package/dist/tui.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function tui(args: string[]): void;
package/dist/tui.js ADDED
@@ -0,0 +1,48 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { existsSync } from "node:fs";
3
+ import { homedir } from "node:os";
4
+ import { delimiter, join } from "node:path";
5
+ import { bold, dim, yellow } from "./util.js";
6
+ /**
7
+ * Hand the terminal to the TUI.
8
+ *
9
+ * @remarks
10
+ * The TUI is a compiled binary rather than part of this package, so this
11
+ * command's whole job is finding it and getting out of the way. `stdio:
12
+ * "inherit"` is the load-bearing part: a full-screen app needs the real
13
+ * terminal, not a pipe, and anything that buffers its output turns it into
14
+ * garbage on the way through.
15
+ *
16
+ * The search order is deliberate. PATH first, so a version someone installed
17
+ * on purpose wins; then the two places it actually lands — cargo's bin, and a
18
+ * checkout's release build — because "command not found" is a useless answer
19
+ * when the binary is sitting in one of two well-known directories.
20
+ */
21
+ const BINARY = "kyb-tui";
22
+ function candidates() {
23
+ const onPath = (process.env.PATH ?? "")
24
+ .split(delimiter)
25
+ .filter(Boolean)
26
+ .map((dir) => join(dir, BINARY));
27
+ return [
28
+ ...onPath,
29
+ join(homedir(), ".cargo", "bin", BINARY),
30
+ join(homedir(), "kyb-tui", "target", "release", BINARY),
31
+ ];
32
+ }
33
+ export function tui(args) {
34
+ const binary = candidates().find((path) => existsSync(path));
35
+ if (!binary) {
36
+ console.log(`\n ${yellow("The terminal app is not installed on this machine.")}\n`);
37
+ console.log(` ${bold("cargo install --path .")} ${dim("from the kyb-tui checkout")}\n`);
38
+ process.exit(1);
39
+ }
40
+ const result = spawnSync(binary, args, { stdio: "inherit" });
41
+ // Exit with what it exited with: a wrapper that always reports success makes
42
+ // the thing it wraps untestable from a script.
43
+ if (result.error) {
44
+ console.error(`\n Could not start the terminal app: ${result.error.message}\n`);
45
+ process.exit(1);
46
+ }
47
+ process.exit(result.status ?? 0);
48
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kybernesis/create",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "The Kybernesis agent scaffolder and FDE toolkit: one command to a governed, remembering, multiplayer, self-testing eve agent — plus doctor and upgrade.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",