kadai 1.0.2 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +11 -8
  2. package/dist/cli.js +26 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -66,6 +66,7 @@ Add metadata as comments in the first 20 lines of any script:
66
66
  # kadai:emoji 🚀
67
67
  # kadai:description Deploy the app to staging
68
68
  # kadai:confirm true
69
+ # kadai:index 10
69
70
  ```
70
71
 
71
72
  For JS/TS, use `//` comments:
@@ -74,16 +75,18 @@ For JS/TS, use `//` comments:
74
75
  // kadai:name Reset Database
75
76
  // kadai:emoji 🗑️
76
77
  // kadai:confirm true
78
+ // kadai:index 20
77
79
  ```
78
80
 
79
- | Key | Type | Description |
80
- |---------------|---------|--------------------------------------------|
81
- | `name` | string | Display name (inferred from filename if omitted) |
82
- | `emoji` | string | Emoji prefix in menus |
83
- | `description` | string | Short description |
84
- | `confirm` | boolean | Require confirmation before running |
85
- | `hidden` | boolean | Hide from menu (still runnable via CLI) |
86
- | `fullscreen` | boolean | Use alternate screen buffer (`.tsx` only) |
81
+ | Key | Type | Description |
82
+ |---------------|---------|--------------------------------------------------------------------|
83
+ | `name` | string | Display name (inferred from filename if omitted) |
84
+ | `emoji` | string | Emoji prefix in menus |
85
+ | `description` | string | Short description |
86
+ | `confirm` | boolean | Require confirmation before running |
87
+ | `hidden` | boolean | Hide from menu (still runnable via CLI) |
88
+ | `fullscreen` | boolean | Use alternate screen buffer (`.tsx` only) |
89
+ | `index` | number | Sort key for menu ordering (indexed actions appear before unindexed) |
87
90
 
88
91
  ### Ink TUI Actions
89
92
 
package/dist/cli.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -990,7 +1008,7 @@ var init_commands = __esm(() => {
990
1008
  var require_package = __commonJS((exports, module) => {
991
1009
  module.exports = {
992
1010
  name: "kadai",
993
- version: "1.0.2",
1011
+ version: "1.0.3",
994
1012
  type: "module",
995
1013
  bin: {
996
1014
  kadai: "./dist/cli.js"
@@ -2900,7 +2918,11 @@ if (parsed.type === "mcp") {
2900
2918
  const projectRoot = kadaiDir ? (await import("path")).dirname(kadaiDir) : cwd;
2901
2919
  await ensureMcpConfig2(projectRoot);
2902
2920
  await startMcpServer2(kadaiDir, cwd);
2903
- await new Promise(() => {});
2921
+ await new Promise((resolve3) => {
2922
+ process.stdin.on("end", resolve3);
2923
+ process.stdin.on("close", resolve3);
2924
+ });
2925
+ process.exit(0);
2904
2926
  }
2905
2927
  if (parsed.type === "list" || parsed.type === "run" || parsed.type === "sync" || parsed.type === "rerun") {
2906
2928
  const kadaiDir = findZcliDir(cwd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kadai",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "kadai": "./dist/cli.js"