@darkrymit/crunes-cli 0.11.2 → 0.12.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.
Files changed (103) hide show
  1. package/README.md +3 -2
  2. package/dist/chunks/{add-2OM5KGN5.js → add-GDF3XEGN.js} +12 -12
  3. package/dist/chunks/{add-A3LBMDLN.js → add-MNDSEEY5.js} +4 -4
  4. package/dist/chunks/{apply-GBUQQ4XF.js → apply-GDTGTBPD.js} +86 -47
  5. package/dist/chunks/{args-KBPMNKBI.js → args-7MIRCGUZ.js} +1 -1
  6. package/dist/chunks/{args-repl-TX3YWUOO.js → args-repl-PDGDJH54.js} +1 -1
  7. package/dist/chunks/{banner-repl-DD22Z33A.js → banner-repl-KVAVC7QA.js} +1 -1
  8. package/dist/chunks/{benchmark-5OWBATUN.js → benchmark-2TVN6HDF.js} +22 -22
  9. package/dist/chunks/{browse-OJVZOMJ7.js → browse-UZOZP72E.js} +4 -4
  10. package/dist/chunks/{chunk-EHKFHILS.js → chunk-3VFNNPQI.js} +8 -8
  11. package/dist/chunks/{chunk-WE4HDHFU.js → chunk-4SZGKHSW.js} +2 -8
  12. package/dist/chunks/{chunk-2Q3KLBE6.js → chunk-7YY3GPPK.js} +1 -1
  13. package/dist/chunks/{chunk-WCODTMDN.js → chunk-AFAVAB5Q.js} +1 -1
  14. package/dist/chunks/{chunk-JBQXPW7P.js → chunk-ATI5HNNC.js} +9 -9
  15. package/dist/chunks/{chunk-7KYCYDAS.js → chunk-BAIIJ4OC.js} +2 -2
  16. package/dist/chunks/{chunk-UBCAZGLE.js → chunk-BK4WG54O.js} +1 -1
  17. package/dist/chunks/{chunk-MVCBPI4J.js → chunk-C2JSNCGY.js} +4 -4
  18. package/dist/chunks/{chunk-I6MHDUCW.js → chunk-C3SYWLAV.js} +1 -1
  19. package/dist/chunks/{chunk-4GJMCFR6.js → chunk-CBWT3DFR.js} +2 -2
  20. package/dist/chunks/{chunk-FIAFVIAN.js → chunk-CEQBF5LN.js} +2 -2
  21. package/dist/chunks/{chunk-55GTJG5I.js → chunk-DR6PVO72.js} +1 -1
  22. package/dist/chunks/{chunk-VP7YLCQP.js → chunk-ESXRY4PQ.js} +2 -2
  23. package/dist/chunks/{chunk-TPK5AGRA.js → chunk-FATG2PA7.js} +3 -0
  24. package/dist/chunks/{chunk-G4ZAUHHA.js → chunk-FQTZPGA3.js} +1 -1
  25. package/dist/chunks/{chunk-KQMTTEJV.js → chunk-GABVYS5O.js} +7 -7
  26. package/dist/chunks/{chunk-M66PQTTU.js → chunk-GBUZOC3O.js} +1 -1
  27. package/dist/chunks/{chunk-DMMC4X27.js → chunk-HIKE52GN.js} +1 -1
  28. package/dist/chunks/{chunk-MUWDZJN2.js → chunk-HQUMVDQE.js} +14 -6
  29. package/dist/chunks/{chunk-UEUUOAJY.js → chunk-HYPUZ5DT.js} +2 -2
  30. package/dist/chunks/{chunk-E7CZPAM2.js → chunk-J33GQMPV.js} +3 -3
  31. package/dist/chunks/chunk-KP4EW2DS.js +75494 -0
  32. package/dist/chunks/{chunk-EO3CSXWK.js → chunk-OV4WBJT3.js} +1 -1
  33. package/dist/chunks/{create-3TDAFVL2.js → chunk-PBQDFAR4.js} +17 -18
  34. package/dist/chunks/{chunk-CGZL5SSH.js → chunk-PRCVJ727.js} +1 -1
  35. package/dist/chunks/{chunk-GVMT55GH.js → chunk-Q6K5MEDF.js} +3 -3
  36. package/dist/chunks/{chunk-MOAQLHP2.js → chunk-QAP63JIK.js} +13 -13
  37. package/dist/chunks/{chunk-MIKWIFYR.js → chunk-RQ6KHY6W.js} +3 -3
  38. package/dist/chunks/{chunk-MYYP3AVF.js → chunk-THGPCLJD.js} +11 -11
  39. package/dist/chunks/{chunk-WJII3LZK.js → chunk-TR5W5JE3.js} +3 -3
  40. package/dist/chunks/{chunk-2DNYVKBF.js → chunk-UKAIACRQ.js} +3 -3
  41. package/dist/chunks/{chunk-MTJ2KW3V.js → chunk-V2VVG44B.js} +2 -2
  42. package/dist/chunks/{chunk-3KKRNQQU.js → chunk-YUI5RTLD.js} +5 -5
  43. package/dist/chunks/{chunk-AWQ3C7MQ.js → chunk-Z4W3ZDFC.js} +3 -3
  44. package/dist/chunks/{trust-LXXYSF6W.js → chunk-ZLIG4RAI.js} +26 -26
  45. package/dist/chunks/{chunk-2HM5Q52B.js → chunk-ZT4QFTQM.js} +1 -1
  46. package/dist/chunks/{clear-AT7HNUV4.js → clear-KED3XRNY.js} +4 -4
  47. package/dist/chunks/{commands-repl-IPLJ4M7X.js → commands-repl-OFAUVITP.js} +1 -1
  48. package/dist/chunks/{complete-input-repl-IDSCMRYL.js → complete-input-repl-XD647MKR.js} +1 -1
  49. package/dist/chunks/{completions-2MSEWWTG.js → completions-RIIPQ7NM.js} +1 -1
  50. package/dist/chunks/{create-2CQZF53Z.js → create-4DEH53O6.js} +37 -20
  51. package/dist/chunks/{create-EC6TQW7N.js → create-YLXRZQXI.js} +22 -11
  52. package/dist/chunks/create-ZWBV7PPT.js +24 -0
  53. package/dist/chunks/{delete-GKYA2W5Z.js → delete-BGP2NUPV.js} +6 -6
  54. package/dist/chunks/{delete-2EXPFBFC.js → delete-DLSVAHJ2.js} +5 -5
  55. package/dist/chunks/{delete-MJAECXXV.js → delete-JYWT7AQ2.js} +5 -5
  56. package/dist/chunks/{disable-FB64CSYV.js → disable-QLB4FZOF.js} +7 -7
  57. package/dist/chunks/{doctor-WXTY6RGK.js → doctor-SXKAEYUF.js} +21 -21
  58. package/dist/chunks/{enable-UVXHTKCJ.js → enable-D5BM5VZ7.js} +8 -8
  59. package/dist/chunks/{esm-7MEWZCHY.js → esm-O4JK7OBM.js} +1 -1
  60. package/dist/chunks/{globals-SNQFCHMP.js → globals-3P5SNZ7F.js} +2 -2
  61. package/dist/chunks/{init-GPNC7TR5.js → init-EY5R26HE.js} +12 -11
  62. package/dist/chunks/{input-repl-ZBH6FVPV.js → input-repl-LTB6JXUE.js} +1 -1
  63. package/dist/chunks/{install-QV6BNZZE.js → install-FSJAC3CL.js} +17 -17
  64. package/dist/chunks/{intro-3FSOGWPR.js → intro-PN7LT6ZG.js} +15 -15
  65. package/dist/chunks/{kill-TX3PC73P.js → kill-Z7ZDY5MB.js} +3 -3
  66. package/dist/chunks/{list-EHREZR6M.js → list-45SHVKXO.js} +3 -3
  67. package/dist/chunks/{list-JUGL5ZKG.js → list-6R5TGCR5.js} +4 -4
  68. package/dist/chunks/{list-V7VVD5AG.js → list-7QPSR4Z4.js} +3 -3
  69. package/dist/chunks/{list-VA73WPK6.js → list-CS2WYC2Z.js} +4 -4
  70. package/dist/chunks/{list-W4JAYPAA.js → list-THRLETUN.js} +16 -16
  71. package/dist/chunks/{list-J2UCBYAY.js → list-U44ZZ3NZ.js} +13 -15
  72. package/dist/chunks/{list-JB4447YK.js → list-WFMSED5O.js} +10 -10
  73. package/dist/chunks/{list-LC6HB3H3.js → list-WXOQXVZS.js} +4 -4
  74. package/dist/chunks/manifest-6KLIS7BL.js +11 -0
  75. package/dist/chunks/output-JVJFXQPF.js +15 -0
  76. package/dist/chunks/{promise-DUSIQMA2.js → promise-7HBDOM4R.js} +1 -1
  77. package/dist/chunks/{query-2US3CPYT.js → query-JFLHSVT5.js} +4 -4
  78. package/dist/chunks/{registry-IWP7JMNI.js → registry-WABBYKKE.js} +3 -3
  79. package/dist/chunks/{remove-AG7ELQUM.js → remove-Y7T3AQA4.js} +4 -4
  80. package/dist/chunks/{repl-2YWTHUWT.js → repl-I4WMXNU3.js} +1 -1
  81. package/dist/chunks/{repl-32TENE2U.js → repl-PSADU3MJ.js} +24 -24
  82. package/dist/chunks/resolver-YEUZSOS4.js +36 -0
  83. package/dist/chunks/run-CYGL3HTA.js +35 -0
  84. package/dist/chunks/{run-Y4TG3EM3.js → run-EBOKEJQ3.js} +1 -1
  85. package/dist/chunks/{rune-TSED6W3R.js → rune-OQX5EYSQ.js} +52 -39
  86. package/dist/chunks/runner-VUSHR2OR.js +36 -0
  87. package/dist/chunks/{search-P2MEUBIM.js → search-3QFC4Y4I.js} +4 -4
  88. package/dist/chunks/{shell-explain-LKBBP2BG.js → shell-explain-UHWQ6NTV.js} +8 -8
  89. package/dist/chunks/trust-7GU7ODWL.js +20 -0
  90. package/dist/chunks/{uninstall-FZ6NHXUL.js → uninstall-MSCIWDWV.js} +16 -16
  91. package/dist/chunks/{unset-P6IUF7SS.js → unset-OIGQO2WL.js} +4 -4
  92. package/dist/chunks/{update-CK3SSL7M.js → update-4UGPDB56.js} +4 -4
  93. package/dist/chunks/{update-X7QN4KAQ.js → update-IHCYA3JW.js} +17 -17
  94. package/dist/chunks/{utils-VVD4VCTC.js → utils-DJ3BXOQC.js} +5 -5
  95. package/dist/chunks/{version-VOGJQFLH.js → version-QBWEJ45I.js} +4 -4
  96. package/dist/cli.js +65 -65
  97. package/package.json +1 -1
  98. package/dist/chunks/chunk-AG4PDJSY.js +0 -9613
  99. package/dist/chunks/manifest-76MIEL2F.js +0 -11
  100. package/dist/chunks/output-QN5CVJ62.js +0 -15
  101. package/dist/chunks/resolver-WN4HKKBV.js +0 -36
  102. package/dist/chunks/run-WD2ZA63Z.js +0 -35
  103. package/dist/chunks/runner-KA3YHICN.js +0 -36
package/README.md CHANGED
@@ -24,7 +24,7 @@ Install globally via `npm`:
24
24
  npm install -g @darkrymit/crunes-cli
25
25
  ```
26
26
 
27
- *Requires Node.js ≥ 22.*
27
+ *Requires Node.js ≥ 24.*
28
28
 
29
29
  ---
30
30
 
@@ -38,7 +38,7 @@ cd your-project
38
38
  # Initialize .crunes/config.json
39
39
  crunes init
40
40
 
41
- # Scaffold a new rune (.crunes/runes/fetch-status.js)
41
+ # Scaffold a new rune (.crunes/runes/fetch-status/src/index.rune.js)
42
42
  crunes create fetch-status
43
43
 
44
44
  # Run the rune and output the markdown sections
@@ -69,6 +69,7 @@ crunes job kill <id> # Forcefully terminate a running background
69
69
 
70
70
  # Templates, Plugins, and Markets
71
71
  crunes template list # List available rune templates
72
+ crunes template create <name> # Scaffold a new rune template
72
73
  crunes template apply <name> # Copy a template as a new local rune
73
74
  crunes plugin install <pkg> # Install a secure plugin from marketplace
74
75
  crunes plugin list # List active marketplace plugins
@@ -2,28 +2,28 @@ import {
2
2
  getConfigPath,
3
3
  readRawConfig,
4
4
  writeRawConfig
5
- } from "./chunk-E7CZPAM2.js";
5
+ } from "./chunk-J33GQMPV.js";
6
6
  import {
7
7
  output
8
- } from "./chunk-MIKWIFYR.js";
9
- import "./chunk-CGZL5SSH.js";
10
- import "./chunk-WCODTMDN.js";
8
+ } from "./chunk-RQ6KHY6W.js";
9
+ import "./chunk-PRCVJ727.js";
10
+ import "./chunk-AFAVAB5Q.js";
11
11
  import {
12
12
  runtimeOf
13
- } from "./chunk-2DNYVKBF.js";
14
- import "./chunk-3KKRNQQU.js";
13
+ } from "./chunk-UKAIACRQ.js";
14
+ import "./chunk-YUI5RTLD.js";
15
15
  import {
16
16
  isPathCommand
17
- } from "./chunk-UBCAZGLE.js";
18
- import "./chunk-VP7YLCQP.js";
19
- import "./chunk-2HM5Q52B.js";
17
+ } from "./chunk-BK4WG54O.js";
18
+ import "./chunk-ESXRY4PQ.js";
19
+ import "./chunk-ZT4QFTQM.js";
20
20
  import {
21
21
  getStorePath
22
- } from "./chunk-2Q3KLBE6.js";
23
- import "./chunk-55GTJG5I.js";
22
+ } from "./chunk-7YY3GPPK.js";
23
+ import "./chunk-DR6PVO72.js";
24
24
  import {
25
25
  init_require_shim
26
- } from "./chunk-TPK5AGRA.js";
26
+ } from "./chunk-FATG2PA7.js";
27
27
 
28
28
  // src/rune/commands/add.js
29
29
  init_require_shim();
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addMarketplace
3
- } from "./chunk-AWQ3C7MQ.js";
4
- import "./chunk-M66PQTTU.js";
5
- import "./chunk-2Q3KLBE6.js";
3
+ } from "./chunk-Z4W3ZDFC.js";
4
+ import "./chunk-GBUZOC3O.js";
5
+ import "./chunk-7YY3GPPK.js";
6
6
  import {
7
7
  init_require_shim
8
- } from "./chunk-TPK5AGRA.js";
8
+ } from "./chunk-FATG2PA7.js";
9
9
 
10
10
  // src/marketplace/commands/add.js
11
11
  init_require_shim();
@@ -1,38 +1,65 @@
1
+ import {
2
+ scriptLines
3
+ } from "./chunk-ZLIG4RAI.js";
1
4
  import {
2
5
  output
3
- } from "./chunk-MIKWIFYR.js";
6
+ } from "./chunk-RQ6KHY6W.js";
4
7
  import {
5
8
  fe,
6
9
  ge,
7
10
  le,
8
11
  ye
9
- } from "./chunk-CGZL5SSH.js";
10
- import "./chunk-WCODTMDN.js";
12
+ } from "./chunk-PRCVJ727.js";
13
+ import "./chunk-AFAVAB5Q.js";
14
+ import {
15
+ runtimeOf
16
+ } from "./chunk-UKAIACRQ.js";
17
+ import "./chunk-HQUMVDQE.js";
11
18
  import {
12
19
  loadConfig
13
- } from "./chunk-3KKRNQQU.js";
14
- import "./chunk-UBCAZGLE.js";
20
+ } from "./chunk-YUI5RTLD.js";
21
+ import "./chunk-BK4WG54O.js";
15
22
  import {
16
23
  loadRegistry,
17
24
  resolvePluginKey
18
- } from "./chunk-MTJ2KW3V.js";
25
+ } from "./chunk-V2VVG44B.js";
19
26
  import {
20
27
  loadPluginJson
21
- } from "./chunk-FIAFVIAN.js";
22
- import "./chunk-VP7YLCQP.js";
23
- import {
24
- isolateName
25
- } from "./chunk-WE4HDHFU.js";
26
- import "./chunk-2Q3KLBE6.js";
27
- import "./chunk-55GTJG5I.js";
28
+ } from "./chunk-CEQBF5LN.js";
29
+ import "./chunk-ESXRY4PQ.js";
30
+ import "./chunk-4SZGKHSW.js";
31
+ import "./chunk-ZT4QFTQM.js";
32
+ import "./chunk-7YY3GPPK.js";
33
+ import "./chunk-DR6PVO72.js";
28
34
  import {
29
35
  init_require_shim
30
- } from "./chunk-TPK5AGRA.js";
36
+ } from "./chunk-FATG2PA7.js";
31
37
 
32
38
  // src/template/commands/apply.js
33
39
  init_require_shim();
34
40
  import fs from "node:fs/promises";
41
+ import { existsSync } from "node:fs";
35
42
  import path from "node:path";
43
+ var ENTRY_FILE = /^index(\.rune)?\.[^.]+$/i;
44
+ async function findEntries(templateDir) {
45
+ let files;
46
+ try {
47
+ files = await fs.readdir(path.join(templateDir, "src"), { withFileTypes: true });
48
+ } catch {
49
+ return [];
50
+ }
51
+ return files.filter((f) => f.isFile() && ENTRY_FILE.test(f.name) && runtimeOf(`./${f.name}`) !== "file").map((f) => `src/${f.name}`);
52
+ }
53
+ async function describeScript(templateName, templateDir, entry) {
54
+ const files = await fs.readdir(templateDir, { recursive: true, withFileTypes: true });
55
+ const others = files.filter((f) => !f.isDirectory()).map((f) => path.relative(templateDir, path.join(f.parentPath, f.name)).replace(/\\/g, "/")).filter((f) => f !== entry).sort();
56
+ return [
57
+ `Template "${templateName}" runs natively, outside the sandbox, with your full access`,
58
+ ` command: ${entry}`,
59
+ ...scriptLines(path.join(templateDir, entry)),
60
+ ...others.length ? ["", ` also copied: ${others.join(", ")}`] : []
61
+ ].join("\n");
62
+ }
36
63
  async function resolveTemplate(sourceName, templateName, projectRoot) {
37
64
  if (!sourceName || sourceName === "project") {
38
65
  let config = { templates: {} };
@@ -43,13 +70,13 @@ async function resolveTemplate(sourceName, templateName, projectRoot) {
43
70
  const templates = config.templates ?? {};
44
71
  const entry = templates[templateName];
45
72
  if (entry !== void 0) {
46
- if (typeof entry === "string" || entry.path) {
73
+ if (entry.path) {
47
74
  return { type: "local", templateName, entry };
48
75
  }
49
76
  if (entry.plugin) {
50
77
  return { type: "shortcut", templateName, entry };
51
78
  }
52
- return { type: "local", templateName, entry: { ...entry, path: `.crunes/templates/${templateName}.js` } };
79
+ return { type: "local", templateName, entry: { ...entry, path: `.crunes/templates/${templateName}` } };
53
80
  }
54
81
  if (sourceName === "project") return null;
55
82
  }
@@ -84,7 +111,7 @@ async function resolveTemplate(sourceName, templateName, projectRoot) {
84
111
  async function handler({
85
112
  ref,
86
113
  key,
87
- path: runeRelPath,
114
+ path: runePath,
88
115
  name,
89
116
  description,
90
117
  yes = false,
@@ -105,30 +132,14 @@ async function handler({
105
132
  process.exit(1);
106
133
  }
107
134
  const outputKey = key ?? templateName;
108
- runeRelPath = runeRelPath ?? `.crunes/runes/${outputKey}.rune.js`;
109
- if (!/\.rune\.m?js$/i.test(runeRelPath)) {
110
- output.error(`${runeRelPath}: a sandboxed rune's file must be named *.rune.js \u2014 the name is what runs it in the isolate.`);
111
- process.exit(1);
112
- }
113
- const runeAbsPath = path.join(projectRoot, runeRelPath);
135
+ const runeRelDir = (runePath ?? `.crunes/runes/${outputKey}`).replace(/[/\\]+$/, "");
136
+ const runeAbsDir = path.join(projectRoot, runeRelDir);
114
137
  if (!isNonInteractive) ye("crunes template apply");
115
- try {
116
- await fs.access(runeAbsPath);
117
- if (!isNonInteractive) {
118
- const ok = await le({ message: `${runeRelPath} already exists. Overwrite?` });
119
- if (!ok || ok === /* @__PURE__ */ Symbol.for("clack:cancel")) {
120
- ge("Cancelled.");
121
- process.exit(0);
122
- }
123
- }
124
- } catch {
125
- }
126
- await fs.mkdir(path.dirname(runeAbsPath), { recursive: true });
127
138
  let templateMeta = {};
139
+ let templateDir;
128
140
  if (resolved.type === "local") {
129
- const localPath = typeof resolved.entry === "string" ? resolved.entry : resolved.entry.path;
130
- await fs.copyFile(path.resolve(projectRoot, localPath), runeAbsPath);
131
- templateMeta = typeof resolved.entry === "string" ? {} : resolved.entry;
141
+ templateDir = path.resolve(projectRoot, resolved.entry.path);
142
+ templateMeta = resolved.entry;
132
143
  } else if (resolved.type === "shortcut") {
133
144
  const pluginRef = resolved.entry.plugin;
134
145
  const colonIdx = pluginRef.indexOf(":");
@@ -153,16 +164,44 @@ async function handler({
153
164
  output.error(`Template shortcut "${templateName}" \u2192 "${pluginRef}" not found in plugin.`);
154
165
  process.exit(1);
155
166
  }
156
- const templateRelPath = meta?.path ?? `templates/${pluginTemplateKey}.js`;
157
- const srcPath = path.join(pluginEntry.path, templateRelPath);
158
- await fs.copyFile(srcPath, runeAbsPath);
167
+ templateDir = path.join(pluginEntry.path, meta.path ?? `templates/${pluginTemplateKey}`);
159
168
  templateMeta = { ...meta, ...resolved.entry.name && { name: resolved.entry.name }, ...resolved.entry.description && { description: resolved.entry.description } };
160
169
  } else if (resolved.type === "plugin") {
161
- const templateRelPath = resolved.templateMeta?.path ?? `templates/${resolved.templateName}.js`;
162
- const srcPath = path.join(resolved.pluginEntry.path, templateRelPath);
163
- await fs.copyFile(srcPath, runeAbsPath);
170
+ templateDir = path.join(resolved.pluginEntry.path, resolved.templateMeta.path ?? `templates/${resolved.templateName}`);
164
171
  templateMeta = resolved.templateMeta;
165
172
  }
173
+ const entries = await findEntries(templateDir);
174
+ if (entries.length !== 1) {
175
+ output.error(`Template "${templateName}" needs exactly one src/index.* entry in ${templateDir} \u2014 found ${entries.length ? entries.join(", ") : "none"}.`);
176
+ process.exit(1);
177
+ }
178
+ const [entry] = entries;
179
+ if (runtimeOf(`./${entry}`) !== "isolate") {
180
+ if (templateMeta.permissions) {
181
+ output.error(`Template "${templateName}" declares permissions, but ${entry} runs natively with full access, so grants would not apply to it.`);
182
+ process.exit(1);
183
+ }
184
+ console.log(await describeScript(templateName, templateDir, entry) + "\n");
185
+ if (!yes) {
186
+ if (isNonInteractive) {
187
+ output.error("Applying a script template is a decision to make after reading it. Run this in a terminal, or pass -y (crunes -y template apply \u2026) once you have reviewed it.");
188
+ process.exit(1);
189
+ }
190
+ const ok = await le({ message: "Apply this script to run with your full access?" });
191
+ if (ok !== true) {
192
+ ge("Cancelled.");
193
+ process.exit(0);
194
+ }
195
+ }
196
+ }
197
+ if (!isNonInteractive && existsSync(runeAbsDir)) {
198
+ const ok = await le({ message: `${runeRelDir} already exists. Overwrite?` });
199
+ if (ok !== true) {
200
+ ge("Cancelled.");
201
+ process.exit(0);
202
+ }
203
+ }
204
+ await fs.cp(templateDir, runeAbsDir, { recursive: true });
166
205
  const configPath = path.join(configRoot ?? projectRoot, ".crunes", "config.json");
167
206
  let config = { runes: {} };
168
207
  try {
@@ -171,7 +210,7 @@ async function handler({
171
210
  }
172
211
  const resolvedName = name ?? templateMeta.name;
173
212
  const resolvedDesc = description ?? templateMeta.description;
174
- const command = isolateName(runeRelPath);
213
+ const command = `${runeRelDir}/${entry}`;
175
214
  const perms = templateMeta.permissions;
176
215
  const configEntry = {
177
216
  ...resolvedName && { name: resolvedName },
@@ -184,10 +223,10 @@ async function handler({
184
223
  await fs.writeFile(tmp, JSON.stringify(config, null, 2) + "\n", "utf8");
185
224
  await fs.rename(tmp, configPath);
186
225
  if (!isNonInteractive) {
187
- fe(`Created ${runeRelPath}
226
+ fe(`Created ${runeRelDir}
188
227
  Run: crunes run ${outputKey}`);
189
228
  } else {
190
- output.success(`Created ${runeRelPath}`);
229
+ output.success(`Created ${runeRelDir}`);
191
230
  output.info(`Run: crunes run ${outputKey}`);
192
231
  }
193
232
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/docs/commands/args.js
6
6
  init_require_shim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/docs/commands/args-repl.js
6
6
  init_require_shim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/docs/commands/banner-repl.js
6
6
  init_require_shim();
@@ -1,38 +1,38 @@
1
1
  import {
2
2
  joinBracketTokens,
3
3
  parseBracketKey
4
- } from "./chunk-EHKFHILS.js";
4
+ } from "./chunk-3VFNNPQI.js";
5
5
  import {
6
6
  output
7
- } from "./chunk-MIKWIFYR.js";
8
- import "./chunk-CGZL5SSH.js";
7
+ } from "./chunk-RQ6KHY6W.js";
8
+ import "./chunk-PRCVJ727.js";
9
9
  import {
10
10
  source_default
11
- } from "./chunk-WCODTMDN.js";
11
+ } from "./chunk-AFAVAB5Q.js";
12
12
  import {
13
13
  runRune
14
- } from "./chunk-MOAQLHP2.js";
15
- import "./chunk-JBQXPW7P.js";
16
- import "./chunk-2DNYVKBF.js";
17
- import "./chunk-MUWDZJN2.js";
14
+ } from "./chunk-QAP63JIK.js";
15
+ import "./chunk-ATI5HNNC.js";
16
+ import "./chunk-UKAIACRQ.js";
17
+ import "./chunk-HQUMVDQE.js";
18
18
  import {
19
19
  loadConfig
20
- } from "./chunk-3KKRNQQU.js";
21
- import "./chunk-UBCAZGLE.js";
22
- import "./chunk-MTJ2KW3V.js";
23
- import "./chunk-FIAFVIAN.js";
24
- import "./chunk-VP7YLCQP.js";
25
- import "./chunk-WE4HDHFU.js";
26
- import "./chunk-MVCBPI4J.js";
27
- import "./chunk-GVMT55GH.js";
28
- import "./chunk-2HM5Q52B.js";
29
- import "./chunk-WJII3LZK.js";
30
- import "./chunk-G4ZAUHHA.js";
31
- import "./chunk-2Q3KLBE6.js";
32
- import "./chunk-55GTJG5I.js";
20
+ } from "./chunk-YUI5RTLD.js";
21
+ import "./chunk-BK4WG54O.js";
22
+ import "./chunk-V2VVG44B.js";
23
+ import "./chunk-CEQBF5LN.js";
24
+ import "./chunk-ESXRY4PQ.js";
25
+ import "./chunk-4SZGKHSW.js";
26
+ import "./chunk-C2JSNCGY.js";
27
+ import "./chunk-Q6K5MEDF.js";
28
+ import "./chunk-ZT4QFTQM.js";
29
+ import "./chunk-TR5W5JE3.js";
30
+ import "./chunk-FQTZPGA3.js";
31
+ import "./chunk-7YY3GPPK.js";
32
+ import "./chunk-DR6PVO72.js";
33
33
  import {
34
34
  init_require_shim
35
- } from "./chunk-TPK5AGRA.js";
35
+ } from "./chunk-FATG2PA7.js";
36
36
 
37
37
  // src/rune/commands/benchmark.js
38
38
  init_require_shim();
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  searchMarketplaces
3
- } from "./chunk-AWQ3C7MQ.js";
4
- import "./chunk-M66PQTTU.js";
5
- import "./chunk-2Q3KLBE6.js";
3
+ } from "./chunk-Z4W3ZDFC.js";
4
+ import "./chunk-GBUZOC3O.js";
5
+ import "./chunk-7YY3GPPK.js";
6
6
  import {
7
7
  init_require_shim
8
- } from "./chunk-TPK5AGRA.js";
8
+ } from "./chunk-FATG2PA7.js";
9
9
 
10
10
  // src/marketplace/commands/browse.js
11
11
  init_require_shim();
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  isVerbose,
3
3
  output
4
- } from "./chunk-MIKWIFYR.js";
4
+ } from "./chunk-RQ6KHY6W.js";
5
5
  import {
6
6
  describeConfigLayers,
7
7
  runRune
8
- } from "./chunk-MOAQLHP2.js";
8
+ } from "./chunk-QAP63JIK.js";
9
9
  import {
10
10
  renderSection
11
- } from "./chunk-JBQXPW7P.js";
11
+ } from "./chunk-ATI5HNNC.js";
12
12
  import {
13
13
  loadConfig
14
- } from "./chunk-3KKRNQQU.js";
14
+ } from "./chunk-YUI5RTLD.js";
15
15
  import {
16
16
  isGlobMatch,
17
17
  isWildcardMatch
18
- } from "./chunk-MVCBPI4J.js";
18
+ } from "./chunk-C2JSNCGY.js";
19
19
  import {
20
20
  init_require_shim
21
- } from "./chunk-TPK5AGRA.js";
21
+ } from "./chunk-FATG2PA7.js";
22
22
 
23
23
  // src/rune/commands/run.js
24
24
  init_require_shim();
@@ -216,8 +216,8 @@ async function handler({
216
216
  process.exit(1);
217
217
  }
218
218
  if (isBatch) {
219
- const { resolvePluginRune } = await import("./resolver-WN4HKKBV.js");
220
- const { loadPluginJson } = await import("./manifest-76MIEL2F.js");
219
+ const { resolvePluginRune } = await import("./resolver-YEUZSOS4.js");
220
+ const { loadPluginJson } = await import("./manifest-6KLIS7BL.js");
221
221
  for (const seg of segments) {
222
222
  let entry = config.runes?.[seg.key] ?? {};
223
223
  if (!entry.batch && seg.key.includes(":")) {
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/core/rune-entry.js
6
6
  init_require_shim();
7
7
  import { join, isAbsolute } from "node:path";
8
- var ISOLATE_MODULE = /\.rune\.m?js$/i;
9
8
  function blockOf(entry, name) {
10
9
  const block = entry?.[name];
11
10
  if (block == null) return null;
@@ -24,14 +23,9 @@ function blockModule(entry, mode, base) {
24
23
  if (!command) return null;
25
24
  return isAbsolute(command) ? command : join(base, command);
26
25
  }
27
- function isolateName(file) {
28
- if (ISOLATE_MODULE.test(file)) return file;
29
- return file.replace(/\.(m?js)$/i, ".rune.$1");
30
- }
31
26
 
32
27
  export {
33
28
  blockOf,
34
29
  scopedPermissions,
35
- blockModule,
36
- isolateName
30
+ blockModule
37
31
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/store/index.js
6
6
  init_require_shim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // node_modules/chalk/source/index.js
6
6
  init_require_shim();
@@ -2,10 +2,10 @@ import {
2
2
  assertNotMissedRename,
3
3
  resolveInterpreter,
4
4
  runtimeOf
5
- } from "./chunk-2DNYVKBF.js";
5
+ } from "./chunk-UKAIACRQ.js";
6
6
  import {
7
7
  isPathCommand
8
- } from "./chunk-UBCAZGLE.js";
8
+ } from "./chunk-BK4WG54O.js";
9
9
  import {
10
10
  isInlineSchema,
11
11
  loadJsonSchema,
@@ -13,20 +13,20 @@ import {
13
13
  normaliseJsonSchema,
14
14
  undeclaredArgs,
15
15
  validateParsed
16
- } from "./chunk-VP7YLCQP.js";
16
+ } from "./chunk-ESXRY4PQ.js";
17
17
  import {
18
18
  computeEffectivePermissions,
19
19
  isGlobMatch
20
- } from "./chunk-MVCBPI4J.js";
20
+ } from "./chunk-C2JSNCGY.js";
21
21
  import {
22
22
  getLocalBase
23
- } from "./chunk-2Q3KLBE6.js";
23
+ } from "./chunk-7YY3GPPK.js";
24
24
  import {
25
25
  parseArgs
26
- } from "./chunk-55GTJG5I.js";
26
+ } from "./chunk-DR6PVO72.js";
27
27
  import {
28
28
  init_require_shim
29
- } from "./chunk-TPK5AGRA.js";
29
+ } from "./chunk-FATG2PA7.js";
30
30
 
31
31
  // src/docs/help-render.js
32
32
  init_require_shim();
@@ -440,7 +440,7 @@ async function getRunBlockSchema(desc, projectDir, { vars = {}, runeKey = null }
440
440
  if (/\.json$/i.test(desc.argsModule)) {
441
441
  return loadJsonSchema(desc.argsModule, relative(projectDir, desc.argsModule).replace(/\\/g, "/") || desc.argsModule);
442
442
  }
443
- const { getArgsSchema } = await import("./runner-KA3YHICN.js");
443
+ const { getArgsSchema } = await import("./runner-VUSHR2OR.js");
444
444
  return getArgsSchema(desc.argsModule, blockGrants({ permissions: desc.argsPermissions }), projectDir, { vars, runeKey });
445
445
  }
446
446
  function parseOutputLine(line) {
@@ -474,7 +474,7 @@ async function runRunBlock({ dir, key, args, entry, opts = {}, configDir, runeCa
474
474
  const desc = describeRunBlock(entry, configDir);
475
475
  let callArgs = [...desc.argv, ...args];
476
476
  if (desc.runtime === "isolate") {
477
- const { runRuneInIsolate } = await import("./runner-KA3YHICN.js");
477
+ const { runRuneInIsolate } = await import("./runner-VUSHR2OR.js");
478
478
  return runRuneInIsolate(desc.command, blockGrants(desc), callArgs, dir, {
479
479
  runeCallback,
480
480
  sections: opts.sections ?? null,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  PermissionError
3
- } from "./chunk-MVCBPI4J.js";
3
+ } from "./chunk-C2JSNCGY.js";
4
4
  import {
5
5
  init_require_shim
6
- } from "./chunk-TPK5AGRA.js";
6
+ } from "./chunk-FATG2PA7.js";
7
7
 
8
8
  // src/rune/permissions/shell-scan.js
9
9
  init_require_shim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/shared/command.js
6
6
  init_require_shim();
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  getSqlitePluginDir
3
- } from "./chunk-GVMT55GH.js";
3
+ } from "./chunk-Q6K5MEDF.js";
4
4
  import {
5
5
  getCachePluginDir
6
- } from "./chunk-WJII3LZK.js";
6
+ } from "./chunk-TR5W5JE3.js";
7
7
  import {
8
8
  getLocalBase,
9
9
  getProjectsJsonPath
10
- } from "./chunk-2Q3KLBE6.js";
10
+ } from "./chunk-7YY3GPPK.js";
11
11
  import {
12
12
  __commonJS,
13
13
  __toESM,
14
14
  init_require_shim
15
- } from "./chunk-TPK5AGRA.js";
15
+ } from "./chunk-FATG2PA7.js";
16
16
 
17
17
  // node_modules/picomatch/lib/constants.js
18
18
  var require_constants = __commonJS({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/docs/ts-walker.js
6
6
  init_require_shim();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getLocalBase
3
- } from "./chunk-2Q3KLBE6.js";
3
+ } from "./chunk-7YY3GPPK.js";
4
4
  import {
5
5
  init_require_shim
6
- } from "./chunk-TPK5AGRA.js";
6
+ } from "./chunk-FATG2PA7.js";
7
7
 
8
8
  // src/job/registry.js
9
9
  init_require_shim();
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  isInlineSchema,
3
3
  normaliseJsonSchema
4
- } from "./chunk-VP7YLCQP.js";
4
+ } from "./chunk-ESXRY4PQ.js";
5
5
  import {
6
6
  init_require_shim
7
- } from "./chunk-TPK5AGRA.js";
7
+ } from "./chunk-FATG2PA7.js";
8
8
 
9
9
  // src/plugin/manifest.js
10
10
  init_require_shim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_require_shim
3
- } from "./chunk-TPK5AGRA.js";
3
+ } from "./chunk-FATG2PA7.js";
4
4
 
5
5
  // src/rune/api/args-parser.js
6
6
  init_require_shim();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseFlags
3
- } from "./chunk-55GTJG5I.js";
3
+ } from "./chunk-DR6PVO72.js";
4
4
  import {
5
5
  init_require_shim
6
- } from "./chunk-TPK5AGRA.js";
6
+ } from "./chunk-FATG2PA7.js";
7
7
 
8
8
  // src/rune/native/schema.js
9
9
  init_require_shim();