@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
@@ -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/job/stdin-tail.js
6
6
  init_require_shim();
@@ -2,28 +2,24 @@ 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";
8
+ } from "./chunk-RQ6KHY6W.js";
9
9
  import {
10
10
  Ee,
11
+ R,
11
12
  Re,
12
13
  fe,
13
14
  ge,
14
15
  ye
15
- } from "./chunk-CGZL5SSH.js";
16
- import "./chunk-WCODTMDN.js";
17
- import "./chunk-3KKRNQQU.js";
18
- import "./chunk-UBCAZGLE.js";
19
- import "./chunk-VP7YLCQP.js";
16
+ } from "./chunk-PRCVJ727.js";
20
17
  import {
21
18
  getStorePath
22
- } from "./chunk-2Q3KLBE6.js";
23
- import "./chunk-55GTJG5I.js";
19
+ } from "./chunk-7YY3GPPK.js";
24
20
  import {
25
21
  init_require_shim
26
- } from "./chunk-TPK5AGRA.js";
22
+ } from "./chunk-FATG2PA7.js";
27
23
 
28
24
  // src/rune/commands/create.js
29
25
  init_require_shim();
@@ -70,7 +66,7 @@ async function resolveTarget({ configRoot, global, plugin, project, isNonInterac
70
66
  { value: "project", label: "project (.crunes/config.json)", hint: "dev-time project rune" }
71
67
  ]
72
68
  });
73
- if (picked === /* @__PURE__ */ Symbol.for("clack:cancel")) return null;
69
+ if (R(picked)) return null;
74
70
  return picked;
75
71
  }
76
72
  return hasPlugin ? "plugin" : "project";
@@ -288,7 +284,7 @@ async function handler({
288
284
  ye("crunes create");
289
285
  if (!key) {
290
286
  const result = await Re({ message: "Rune key?", validate: (v) => v ? void 0 : "Required" });
291
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
287
+ if (R(result)) {
292
288
  ge("Cancelled.");
293
289
  return;
294
290
  }
@@ -302,7 +298,7 @@ async function handler({
302
298
  { value: "markdown", label: "markdown", hint: "freeform markdown content" }
303
299
  ]
304
300
  });
305
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
301
+ if (R(result)) {
306
302
  ge("Cancelled.");
307
303
  return;
308
304
  }
@@ -311,7 +307,7 @@ async function handler({
311
307
  if (!runeRelPath) {
312
308
  const defaultPath = defaultRunePaths({ target, key, ext: "rune.js", pluginManifest }).runeRelPath;
313
309
  const result = await Re({ message: "File path?", initialValue: defaultPath });
314
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
310
+ if (R(result)) {
315
311
  ge("Cancelled.");
316
312
  return;
317
313
  }
@@ -319,7 +315,7 @@ async function handler({
319
315
  }
320
316
  if (!name) {
321
317
  const result = await Re({ message: "Name? (optional)", placeholder: "Human-readable label for crunes list" });
322
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
318
+ if (R(result)) {
323
319
  ge("Cancelled.");
324
320
  return;
325
321
  }
@@ -327,7 +323,7 @@ async function handler({
327
323
  }
328
324
  if (!description) {
329
325
  const result = await Re({ message: "Description? (optional)", placeholder: "What context does this rune provide?" });
330
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
326
+ if (R(result)) {
331
327
  ge("Cancelled.");
332
328
  return;
333
329
  }
@@ -359,8 +355,11 @@ Run: crunes run ${key}`);
359
355
  output.info(`Run: crunes run ${key}`);
360
356
  }
361
357
  }
358
+
362
359
  export {
360
+ runeTestTemplate,
361
+ SCRIPT_LANGS,
363
362
  VALID_LANGS,
364
- handler,
365
- template
363
+ template,
364
+ handler
366
365
  };
@@ -2,7 +2,7 @@ import {
2
2
  __commonJS,
3
3
  __toESM,
4
4
  init_require_shim
5
- } from "./chunk-TPK5AGRA.js";
5
+ } from "./chunk-FATG2PA7.js";
6
6
 
7
7
  // node_modules/sisteransi/src/index.js
8
8
  var require_src = __commonJS({
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  storageKey
3
- } from "./chunk-G4ZAUHHA.js";
3
+ } from "./chunk-FQTZPGA3.js";
4
4
  import {
5
5
  getLocalBase,
6
6
  getSqliteBasePath,
7
7
  getSqliteJsonPath
8
- } from "./chunk-2Q3KLBE6.js";
8
+ } from "./chunk-7YY3GPPK.js";
9
9
  import {
10
10
  init_require_shim
11
- } from "./chunk-TPK5AGRA.js";
11
+ } from "./chunk-FATG2PA7.js";
12
12
 
13
13
  // src/sqlite/index.js
14
14
  init_require_shim();
@@ -1,37 +1,37 @@
1
1
  import {
2
2
  runRunBlock
3
- } from "./chunk-JBQXPW7P.js";
3
+ } from "./chunk-ATI5HNNC.js";
4
4
  import {
5
5
  isNativeRune,
6
6
  trustDigest,
7
7
  trustState,
8
8
  untrustedError
9
- } from "./chunk-MUWDZJN2.js";
9
+ } from "./chunk-HQUMVDQE.js";
10
10
  import {
11
11
  enabledPluginKeys,
12
12
  getRune
13
- } from "./chunk-3KKRNQQU.js";
13
+ } from "./chunk-YUI5RTLD.js";
14
14
  import {
15
15
  loadRegistry,
16
16
  resolvePluginKeyScoped
17
- } from "./chunk-MTJ2KW3V.js";
17
+ } from "./chunk-V2VVG44B.js";
18
18
  import {
19
19
  loadPluginJson
20
- } from "./chunk-FIAFVIAN.js";
20
+ } from "./chunk-CEQBF5LN.js";
21
21
  import {
22
22
  blockModule,
23
23
  scopedPermissions
24
- } from "./chunk-WE4HDHFU.js";
24
+ } from "./chunk-4SZGKHSW.js";
25
25
  import {
26
26
  computeEffectivePermissions
27
- } from "./chunk-MVCBPI4J.js";
27
+ } from "./chunk-C2JSNCGY.js";
28
28
  import {
29
29
  getLocalBase,
30
30
  getStorePath
31
- } from "./chunk-2Q3KLBE6.js";
31
+ } from "./chunk-7YY3GPPK.js";
32
32
  import {
33
33
  init_require_shim
34
- } from "./chunk-TPK5AGRA.js";
34
+ } from "./chunk-FATG2PA7.js";
35
35
 
36
36
  // src/rune/resolver.js
37
37
  init_require_shim();
@@ -127,7 +127,7 @@ async function runPluginMatch({ match, pluginJson, projectPerms, projectVars, ke
127
127
  });
128
128
  return result2?.directExitCode !== void 0 ? result2 : normaliseResult(result2);
129
129
  }
130
- const { executePluginRune } = await import("./runner-KA3YHICN.js");
130
+ const { executePluginRune } = await import("./runner-VUSHR2OR.js");
131
131
  const result = await executePluginRune({
132
132
  pluginDir,
133
133
  pluginCacheDir,
@@ -225,7 +225,7 @@ async function resolveRuneEntry(projectDir, config, key, configDir = projectDir)
225
225
  const vars = { ...pluginJson.runes[runeKey]?.vars ?? {}, ...config.runes?.[`${pluginKey}:${runeKey}`]?.vars ?? {} };
226
226
  return {
227
227
  async createReplSession(args, opts = {}) {
228
- const { getPluginRunePath, runRuneInRepl } = await import("./runner-KA3YHICN.js");
228
+ const { getPluginRunePath, runRuneInRepl } = await import("./runner-VUSHR2OR.js");
229
229
  const runeFile = getPluginRunePath(pluginDir, runeKey, pluginJson, "repl");
230
230
  const nodeModulesDir = join(pluginCacheDir, "node_modules");
231
231
  return runRuneInRepl(runeFile, effective, args, projectDir, {
@@ -251,7 +251,7 @@ async function resolveRuneEntry(projectDir, config, key, configDir = projectDir)
251
251
  const vars = entry.vars ?? {};
252
252
  return {
253
253
  async createReplSession(args, opts = {}) {
254
- const { runRuneInRepl } = await import("./runner-KA3YHICN.js");
254
+ const { runRuneInRepl } = await import("./runner-VUSHR2OR.js");
255
255
  return runRuneInRepl(runeFile, effective, args, projectDir, {
256
256
  vars,
257
257
  runeKey: key,
@@ -275,7 +275,7 @@ async function resolveRuneEntry(projectDir, config, key, configDir = projectDir)
275
275
  const vars = { ...pluginJson.runes[runeKey]?.vars ?? {}, ...config.runes?.[`${pluginKey}:${runeKey}`]?.vars ?? {} };
276
276
  return {
277
277
  async createReplSession(args, opts = {}) {
278
- const { getPluginRunePath, runRuneInRepl } = await import("./runner-KA3YHICN.js");
278
+ const { getPluginRunePath, runRuneInRepl } = await import("./runner-VUSHR2OR.js");
279
279
  const runeFile = getPluginRunePath(pluginDir, runeKey, pluginJson, "repl");
280
280
  const nodeModulesDir = join(pluginCacheDir, "node_modules");
281
281
  return runRuneInRepl(runeFile, effective, args, projectDir, {
@@ -4,13 +4,13 @@ import {
4
4
  fe,
5
5
  ge,
6
6
  ye
7
- } from "./chunk-CGZL5SSH.js";
7
+ } from "./chunk-PRCVJ727.js";
8
8
  import {
9
9
  source_default
10
- } from "./chunk-WCODTMDN.js";
10
+ } from "./chunk-AFAVAB5Q.js";
11
11
  import {
12
12
  init_require_shim
13
- } from "./chunk-TPK5AGRA.js";
13
+ } from "./chunk-FATG2PA7.js";
14
14
 
15
15
  // src/shared/output.js
16
16
  init_require_shim();
@@ -1,45 +1,45 @@
1
1
  import {
2
2
  fo
3
- } from "./chunk-M66PQTTU.js";
3
+ } from "./chunk-GBUZOC3O.js";
4
4
  import {
5
5
  getConfigPath,
6
6
  readRawConfig,
7
7
  setPluginEnabled,
8
8
  writeRawConfig
9
- } from "./chunk-E7CZPAM2.js";
9
+ } from "./chunk-J33GQMPV.js";
10
10
  import {
11
11
  output
12
- } from "./chunk-MIKWIFYR.js";
12
+ } from "./chunk-RQ6KHY6W.js";
13
13
  import {
14
14
  R,
15
15
  le
16
- } from "./chunk-CGZL5SSH.js";
16
+ } from "./chunk-PRCVJ727.js";
17
17
  import {
18
18
  isNativeRune
19
- } from "./chunk-MUWDZJN2.js";
19
+ } from "./chunk-HQUMVDQE.js";
20
20
  import {
21
21
  coercePlugins
22
- } from "./chunk-3KKRNQQU.js";
22
+ } from "./chunk-YUI5RTLD.js";
23
23
  import {
24
24
  loadRegistry,
25
25
  registerPlugin,
26
26
  removePlugin
27
- } from "./chunk-MTJ2KW3V.js";
27
+ } from "./chunk-V2VVG44B.js";
28
28
  import {
29
29
  loadPluginJson
30
- } from "./chunk-FIAFVIAN.js";
30
+ } from "./chunk-CEQBF5LN.js";
31
31
  import {
32
32
  blockOf,
33
33
  scopedPermissions
34
- } from "./chunk-WE4HDHFU.js";
34
+ } from "./chunk-4SZGKHSW.js";
35
35
  import {
36
36
  ensureStoreDirs,
37
37
  getPluginCacheDir,
38
38
  getPnpmStorePath
39
- } from "./chunk-2Q3KLBE6.js";
39
+ } from "./chunk-7YY3GPPK.js";
40
40
  import {
41
41
  init_require_shim
42
- } from "./chunk-TPK5AGRA.js";
42
+ } from "./chunk-FATG2PA7.js";
43
43
 
44
44
  // src/plugin/install.js
45
45
  init_require_shim();
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  storageKey
3
- } from "./chunk-G4ZAUHHA.js";
3
+ } from "./chunk-FQTZPGA3.js";
4
4
  import {
5
5
  getCacheBasePath,
6
6
  getCacheJsonPath,
7
7
  getLocalBase
8
- } from "./chunk-2Q3KLBE6.js";
8
+ } from "./chunk-7YY3GPPK.js";
9
9
  import {
10
10
  init_require_shim
11
- } from "./chunk-TPK5AGRA.js";
11
+ } from "./chunk-FATG2PA7.js";
12
12
 
13
13
  // src/cache/index.js
14
14
  init_require_shim();
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  isPathCommand
3
- } from "./chunk-UBCAZGLE.js";
3
+ } from "./chunk-BK4WG54O.js";
4
4
  import {
5
5
  defaultDeps,
6
6
  resolveShell
7
- } from "./chunk-2HM5Q52B.js";
7
+ } from "./chunk-ZT4QFTQM.js";
8
8
  import {
9
9
  init_require_shim
10
- } from "./chunk-TPK5AGRA.js";
10
+ } from "./chunk-FATG2PA7.js";
11
11
 
12
12
  // src/rune/native/runtime.js
13
13
  init_require_shim();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getPluginsJsonPath
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/plugin/registry.js
9
9
  init_require_shim();
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  isPathCommand
3
- } from "./chunk-UBCAZGLE.js";
3
+ } from "./chunk-BK4WG54O.js";
4
4
  import {
5
5
  isInlineSchema,
6
6
  normaliseJsonSchema
7
- } from "./chunk-VP7YLCQP.js";
7
+ } from "./chunk-ESXRY4PQ.js";
8
8
  import {
9
9
  getStorePath
10
- } from "./chunk-2Q3KLBE6.js";
10
+ } from "./chunk-7YY3GPPK.js";
11
11
  import {
12
12
  init_require_shim
13
- } from "./chunk-TPK5AGRA.js";
13
+ } from "./chunk-FATG2PA7.js";
14
14
 
15
15
  // src/core/config.js
16
16
  init_require_shim();
@@ -32,7 +32,7 @@ function absolutizeSection(section, kind, baseDir, layer) {
32
32
  if (kind === "templates") {
33
33
  const isPluginRef = Boolean(entry.plugin) || key.includes(":");
34
34
  if (entry.path) copy.path = resolve(baseDir, entry.path);
35
- else if (layer === "global" && !isPluginRef) copy.path = resolve(baseDir, `templates/${key}.js`);
35
+ else if (layer === "global" && !isPluginRef) copy.path = resolve(baseDir, `templates/${key}`);
36
36
  out[key] = copy;
37
37
  continue;
38
38
  }
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  fo
3
- } from "./chunk-M66PQTTU.js";
3
+ } from "./chunk-GBUZOC3O.js";
4
4
  import {
5
5
  ensureStoreDirs,
6
6
  getMarketplaceCacheDir,
7
7
  getMarketplacesJsonPath
8
- } from "./chunk-2Q3KLBE6.js";
8
+ } from "./chunk-7YY3GPPK.js";
9
9
  import {
10
10
  init_require_shim
11
- } from "./chunk-TPK5AGRA.js";
11
+ } from "./chunk-FATG2PA7.js";
12
12
 
13
13
  // src/marketplace/marketplace.js
14
14
  init_require_shim();
@@ -1,36 +1,49 @@
1
1
  import {
2
2
  R,
3
3
  le
4
- } from "./chunk-CGZL5SSH.js";
4
+ } from "./chunk-PRCVJ727.js";
5
5
  import {
6
6
  isNativeRune,
7
7
  nativeRuneFile,
8
8
  recordTrust,
9
9
  trustDigest,
10
10
  trustState
11
- } from "./chunk-MUWDZJN2.js";
12
- import "./chunk-UBCAZGLE.js";
11
+ } from "./chunk-HQUMVDQE.js";
13
12
  import {
14
13
  loadRegistry,
15
14
  resolvePluginKey
16
- } from "./chunk-MTJ2KW3V.js";
15
+ } from "./chunk-V2VVG44B.js";
17
16
  import {
18
17
  loadPluginJson
19
- } from "./chunk-FIAFVIAN.js";
20
- import "./chunk-VP7YLCQP.js";
18
+ } from "./chunk-CEQBF5LN.js";
21
19
  import {
22
20
  blockOf
23
- } from "./chunk-WE4HDHFU.js";
24
- import "./chunk-2Q3KLBE6.js";
25
- import "./chunk-55GTJG5I.js";
21
+ } from "./chunk-4SZGKHSW.js";
26
22
  import {
27
23
  init_require_shim
28
- } from "./chunk-TPK5AGRA.js";
24
+ } from "./chunk-FATG2PA7.js";
29
25
 
30
26
  // src/plugin/commands/trust.js
31
27
  init_require_shim();
32
28
  import { readFileSync } from "node:fs";
33
29
  var SHOWN_LINES = 80;
30
+ function scriptLines(file) {
31
+ const lines = [` file: ${file}`, ""];
32
+ let content;
33
+ try {
34
+ content = readFileSync(file, "utf8");
35
+ } catch {
36
+ content = null;
37
+ }
38
+ if (content == null) {
39
+ lines.push(" (the file is missing)");
40
+ } else {
41
+ const all = content.replace(/\n$/, "").split("\n");
42
+ for (const line of all.slice(0, SHOWN_LINES)) lines.push(` \u2502 ${line}`);
43
+ if (all.length > SHOWN_LINES) lines.push(` \u2502 \u2026 ${all.length - SHOWN_LINES} more lines \u2014 read the whole file before trusting it`);
44
+ }
45
+ return lines;
46
+ }
34
47
  function describeForReview(pluginKey, runeKey, rune, pluginDir, state) {
35
48
  const run = blockOf(rune, "run");
36
49
  const file = nativeRuneFile(pluginDir, rune);
@@ -40,22 +53,7 @@ function describeForReview(pluginKey, runeKey, rune, pluginDir, state) {
40
53
  ` command: ${[run.command, ...run.argv ?? []].join(" ")}${file ? "" : " (a program on PATH)"}`
41
54
  ];
42
55
  if (rune.args != null) lines.push(` arguments: ${run.pass === "mapped" ? "mapped from its schema \u2014 nothing else reaches the program" : "passed through as given"}`);
43
- if (file) {
44
- let content;
45
- try {
46
- content = readFileSync(file, "utf8");
47
- } catch {
48
- content = null;
49
- }
50
- lines.push(` file: ${file}`, "");
51
- if (content == null) {
52
- lines.push(" (the file is missing)");
53
- } else {
54
- const all = content.replace(/\n$/, "").split("\n");
55
- for (const line of all.slice(0, SHOWN_LINES)) lines.push(` \u2502 ${line}`);
56
- if (all.length > SHOWN_LINES) lines.push(` \u2502 \u2026 ${all.length - SHOWN_LINES} more lines \u2014 read the whole file before trusting it`);
57
- }
58
- }
56
+ if (file) lines.push(...scriptLines(file));
59
57
  return lines.join("\n");
60
58
  }
61
59
  async function handler({ name, rune: onlyRune = null, yes = false }) {
@@ -103,7 +101,9 @@ async function handler({ name, rune: onlyRune = null, yes = false }) {
103
101
  process.exit(1);
104
102
  }
105
103
  }
104
+
106
105
  export {
106
+ scriptLines,
107
107
  describeForReview,
108
108
  handler
109
109
  };
@@ -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/shell-resolve.js
6
6
  init_require_shim();
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  clearCacheBucket
3
- } from "./chunk-WJII3LZK.js";
4
- import "./chunk-G4ZAUHHA.js";
5
- import "./chunk-2Q3KLBE6.js";
3
+ } from "./chunk-TR5W5JE3.js";
4
+ import "./chunk-FQTZPGA3.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/cache/commands/clear.js
11
11
  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/commands-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/complete-input-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/cli/commands/completions.js
6
6
  init_require_shim();
@@ -1,28 +1,34 @@
1
+ import {
2
+ SCRIPT_LANGS,
3
+ VALID_LANGS,
4
+ runeTestTemplate
5
+ } from "./chunk-PBQDFAR4.js";
1
6
  import {
2
7
  getConfigPath,
3
8
  readRawConfig,
4
9
  writeRawConfig
5
- } from "./chunk-E7CZPAM2.js";
10
+ } from "./chunk-J33GQMPV.js";
6
11
  import {
7
12
  output
8
- } from "./chunk-MIKWIFYR.js";
13
+ } from "./chunk-RQ6KHY6W.js";
9
14
  import {
15
+ R,
10
16
  Re,
11
17
  fe,
12
18
  ge,
13
19
  ye
14
- } from "./chunk-CGZL5SSH.js";
15
- import "./chunk-WCODTMDN.js";
16
- import "./chunk-3KKRNQQU.js";
17
- import "./chunk-UBCAZGLE.js";
18
- import "./chunk-VP7YLCQP.js";
20
+ } from "./chunk-PRCVJ727.js";
21
+ import "./chunk-AFAVAB5Q.js";
22
+ import "./chunk-YUI5RTLD.js";
23
+ import "./chunk-BK4WG54O.js";
24
+ import "./chunk-ESXRY4PQ.js";
19
25
  import {
20
26
  getStorePath
21
- } from "./chunk-2Q3KLBE6.js";
22
- import "./chunk-55GTJG5I.js";
27
+ } from "./chunk-7YY3GPPK.js";
28
+ import "./chunk-DR6PVO72.js";
23
29
  import {
24
30
  init_require_shim
25
- } from "./chunk-TPK5AGRA.js";
31
+ } from "./chunk-FATG2PA7.js";
26
32
 
27
33
  // src/template/commands/create.js
28
34
  init_require_shim();
@@ -61,6 +67,7 @@ function templateStub(name) {
61
67
  async function handler({
62
68
  name,
63
69
  path: templateRelPath,
70
+ lang,
64
71
  templateName,
65
72
  description,
66
73
  yes = false,
@@ -69,6 +76,10 @@ async function handler({
69
76
  global = false
70
77
  } = {}) {
71
78
  const isNonInteractive = yes || !process.stdout.isTTY;
79
+ if (lang && !VALID_LANGS.includes(lang)) {
80
+ output.error(`Invalid --lang. Must be one of: ${VALID_LANGS.join(", ")}`);
81
+ process.exit(1);
82
+ }
72
83
  if (isNonInteractive) {
73
84
  if (!name) {
74
85
  output.error("Missing required argument: <name>");
@@ -78,16 +89,16 @@ async function handler({
78
89
  ye("crunes template create");
79
90
  if (!name) {
80
91
  const result = await Re({ message: "Template name?", validate: (v) => v ? void 0 : "Required" });
81
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
92
+ if (R(result)) {
82
93
  ge("Cancelled.");
83
94
  return;
84
95
  }
85
96
  name = result;
86
97
  }
87
98
  if (!templateRelPath) {
88
- const defaultPath = global ? `templates/${name}.js` : `.crunes/templates/${name}.js`;
89
- const result = await Re({ message: "File path?", initialValue: defaultPath });
90
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
99
+ const defaultPath = global ? `templates/${name}` : `.crunes/templates/${name}`;
100
+ const result = await Re({ message: "Folder?", initialValue: defaultPath });
101
+ if (R(result)) {
91
102
  ge("Cancelled.");
92
103
  return;
93
104
  }
@@ -95,7 +106,7 @@ async function handler({
95
106
  }
96
107
  if (!templateName) {
97
108
  const result = await Re({ message: "Display name? (optional)", placeholder: "Human-readable label for crunes template list" });
98
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
109
+ if (R(result)) {
99
110
  ge("Cancelled.");
100
111
  return;
101
112
  }
@@ -103,18 +114,24 @@ async function handler({
103
114
  }
104
115
  if (!description) {
105
116
  const result = await Re({ message: "Description? (optional)", placeholder: "What kind of rune does this template produce?" });
106
- if (result === /* @__PURE__ */ Symbol.for("clack:cancel")) {
117
+ if (R(result)) {
107
118
  ge("Cancelled.");
108
119
  return;
109
120
  }
110
121
  description = result || void 0;
111
122
  }
112
123
  }
113
- templateRelPath = templateRelPath ?? (global ? `templates/${name}.js` : `.crunes/templates/${name}.js`);
124
+ templateRelPath = templateRelPath ?? (global ? `templates/${name}` : `.crunes/templates/${name}`);
114
125
  const baseRoot = global ? getStorePath() : configRoot;
115
- const templateAbsPath = join(baseRoot, templateRelPath);
116
- await mkdir(dirname(templateAbsPath), { recursive: true });
117
- await writeFile(templateAbsPath, templateStub(name));
126
+ const script = lang ? SCRIPT_LANGS[lang] : null;
127
+ const files = [
128
+ script ? [join(baseRoot, templateRelPath, "src", `index.${script.ext}`), script.body(name)] : [join(baseRoot, templateRelPath, "src", "index.rune.js"), templateStub(name)],
129
+ [join(baseRoot, templateRelPath, "test", `${name}.test.js`), runeTestTemplate(name)]
130
+ ];
131
+ for (const [filePath, content] of files) {
132
+ await mkdir(dirname(filePath), { recursive: true });
133
+ await writeFile(filePath, content);
134
+ }
118
135
  const configPath = getConfigPath({ configRoot, global });
119
136
  const config = readRawConfig(configPath) ?? { runes: {} };
120
137
  const entry = {