@darkrymit/crunes-cli 0.8.5 → 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.
Files changed (95) hide show
  1. package/dist/chunks/{add-CBHWFGCA.js → add-IT3IHBPO.js} +2 -2
  2. package/dist/chunks/add-MSX6XSU3.js +68 -0
  3. package/dist/chunks/{apply-J4YICV6H.js → apply-LOIJIPLR.js} +21 -12
  4. package/dist/chunks/{benchmark-AKKV7G32.js → benchmark-3IHFP3V2.js} +27 -18
  5. package/dist/chunks/{browse-JZFU52ET.js → browse-PHMBDREQ.js} +2 -2
  6. package/dist/chunks/chunk-2DNYVKBF.js +109 -0
  7. package/dist/chunks/chunk-2FI6KN3C.js +283 -0
  8. package/dist/chunks/chunk-2HM5Q52B.js +131 -0
  9. package/dist/chunks/{chunk-6MRZXASS.js → chunk-2Q3KLBE6.js} +16 -0
  10. package/dist/chunks/{chunk-ZJDKCC2Y.js → chunk-4GJMCFR6.js} +6 -3
  11. package/dist/chunks/chunk-55GTJG5I.js +1154 -0
  12. package/dist/chunks/chunk-6IC6ZJ74.js +9525 -0
  13. package/dist/chunks/chunk-7KYCYDAS.js +325 -0
  14. package/dist/chunks/chunk-DTOYFY3Z.js +578 -0
  15. package/dist/chunks/chunk-EO3CSXWK.js +70 -0
  16. package/dist/chunks/chunk-FIAFVIAN.js +79 -0
  17. package/dist/chunks/{chunk-J3GZ3DXD.js → chunk-GVMT55GH.js} +3 -2
  18. package/dist/chunks/chunk-H2OT7D6N.js +303 -0
  19. package/dist/chunks/{chunk-JOAL437H.js → chunk-I6MHDUCW.js} +16 -1
  20. package/dist/chunks/chunk-KSQDFE5N.js +85 -0
  21. package/dist/chunks/{chunk-BTIPUR5S.js → chunk-KUEMDPNG.js} +108 -91
  22. package/dist/chunks/{chunk-6XLT25GS.js → chunk-MIKWIFYR.js} +47 -0
  23. package/dist/chunks/{chunk-GTCPZ22N.js → chunk-MTJ2KW3V.js} +3 -1
  24. package/dist/chunks/chunk-MVCBPI4J.js +2354 -0
  25. package/dist/chunks/{chunk-T53L5CJW.js → chunk-PBGUKXT6.js} +2887 -1874
  26. package/dist/chunks/{chunk-KII6KW5Z.js → chunk-RVBAAXRY.js} +64 -44
  27. package/dist/chunks/chunk-SUCYDYMU.js +44 -0
  28. package/dist/chunks/chunk-UBCAZGLE.js +15 -0
  29. package/dist/chunks/{chunk-63H5VXZY.js → chunk-UEUUOAJY.js} +4 -1
  30. package/dist/chunks/chunk-VP7YLCQP.js +244 -0
  31. package/dist/chunks/{chunk-NDEYEYSU.js → chunk-WJII3LZK.js} +4 -3
  32. package/dist/chunks/chunk-XDMMSZIL.js +71 -0
  33. package/dist/chunks/chunk-YKIKJHYO.js +94 -0
  34. package/dist/chunks/{chunk-NYLRTAAA.js → chunk-YVN3VDRE.js} +1 -1
  35. package/dist/chunks/{clear-YBDIPEEH.js → clear-AT7HNUV4.js} +2 -2
  36. package/dist/chunks/{create-L6DJN4ME.js → create-DXW4YYLJ.js} +8 -8
  37. package/dist/chunks/create-LPLNCOW4.js +268 -0
  38. package/dist/chunks/{create-GPDE2YKL.js → create-Y4LHLWGL.js} +26 -18
  39. package/dist/chunks/{delete-LNOYM5KG.js → delete-2EXPFBFC.js} +2 -2
  40. package/dist/chunks/{delete-E4TEBRPX.js → delete-GKYA2W5Z.js} +4 -2
  41. package/dist/chunks/{delete-C4UJ7X5K.js → delete-MJAECXXV.js} +2 -2
  42. package/dist/chunks/disable-TITOSMXB.js +43 -0
  43. package/dist/chunks/doctor-R2Y6UAY4.js +208 -0
  44. package/dist/chunks/enable-LGTPDWPV.js +35 -0
  45. package/dist/chunks/{globals-H2WF344Y.js → globals-SNQFCHMP.js} +1 -1
  46. package/dist/chunks/{init-HU5OMHEH.js → init-KO2HLED5.js} +18 -8
  47. package/dist/chunks/install-7IRUAGSF.js +64 -0
  48. package/dist/chunks/{intro-36OLGNYN.js → intro-JNJ6A75J.js} +89 -21
  49. package/dist/chunks/{kill-2UG7PHUV.js → kill-TX3PC73P.js} +2 -1
  50. package/dist/chunks/{list-2JYMBMZC.js → list-BCCM3TLP.js} +12 -7
  51. package/dist/chunks/{list-4X3JFQGS.js → list-EHREZR6M.js} +2 -1
  52. package/dist/chunks/{list-U7PAYNAH.js → list-LC6HB3H3.js} +2 -2
  53. package/dist/chunks/list-MLKZE36K.js +92 -0
  54. package/dist/chunks/list-QVZKR3IE.js +62 -0
  55. package/dist/chunks/{list-7VHJIUDX.js → list-U4EMHQZT.js} +2 -2
  56. package/dist/chunks/{list-PTAWQYWG.js → list-V7VVD5AG.js} +2 -1
  57. package/dist/chunks/{list-A5WVDBWF.js → list-VA73WPK6.js} +2 -2
  58. package/dist/chunks/{manifest-7RVNKBOH.js → manifest-76MIEL2F.js} +3 -1
  59. package/dist/chunks/migrate-Y3EKMVP5.js +87 -0
  60. package/dist/chunks/{output-RJ6JSNY7.js → output-QN5CVJ62.js} +4 -1
  61. package/dist/chunks/{query-AW7WYILM.js → query-2US3CPYT.js} +2 -2
  62. package/dist/chunks/{registry-RG34DPD7.js → registry-IWP7JMNI.js} +2 -2
  63. package/dist/chunks/{remove-QUH2D3S5.js → remove-BCFTF23J.js} +2 -2
  64. package/dist/chunks/{repl-STBZC4P2.js → repl-2YWTHUWT.js} +4 -0
  65. package/dist/chunks/{repl-BPEWARN7.js → repl-5GDN3RAO.js} +99 -31
  66. package/dist/chunks/resolver-CA2A32AC.js +36 -0
  67. package/dist/chunks/run-WL3IZBXF.js +35 -0
  68. package/dist/chunks/rune-YA4TFHTB.js +283 -0
  69. package/dist/chunks/runner-QNZMBHQY.js +34 -0
  70. package/dist/chunks/{search-MSSDGJTF.js → search-B7IM7JRJ.js} +2 -2
  71. package/dist/chunks/shell-explain-LKBBP2BG.js +77 -0
  72. package/dist/chunks/trust-BFIDANXD.js +109 -0
  73. package/dist/chunks/uninstall-3MWZIZVA.js +58 -0
  74. package/dist/chunks/{unset-YASSMSE5.js → unset-P6IUF7SS.js} +2 -2
  75. package/dist/chunks/{update-KSC6VRMU.js → update-W4MJUTTW.js} +25 -19
  76. package/dist/chunks/{update-EWWDROKW.js → update-WXT7CHYA.js} +2 -2
  77. package/dist/chunks/{utils-3SJFSUSV.js → utils-B2QULX5J.js} +8 -4
  78. package/dist/chunks/{version-YG2M7HER.js → version-FLHI5KFS.js} +3 -3
  79. package/dist/cli.js +115 -70
  80. package/package.json +2 -2
  81. package/dist/chunks/chunk-ASZKAC24.js +0 -103
  82. package/dist/chunks/chunk-G3U4V32O.js +0 -46
  83. package/dist/chunks/chunk-GSA432UC.js +0 -90
  84. package/dist/chunks/chunk-WJRZN7BR.js +0 -77492
  85. package/dist/chunks/create-VYZRWRGQ.js +0 -170
  86. package/dist/chunks/disable-FGJ7VMPO.js +0 -47
  87. package/dist/chunks/doctor-7NWBJAH7.js +0 -53
  88. package/dist/chunks/enable-ZL6QOC2I.js +0 -47
  89. package/dist/chunks/install-FIYRMVLR.js +0 -57
  90. package/dist/chunks/list-AIYNOPNZ.js +0 -28
  91. package/dist/chunks/list-NZ5DHXJF.js +0 -111
  92. package/dist/chunks/resolver-36V72VKR.js +0 -28
  93. package/dist/chunks/run-IVL23SMW.js +0 -26
  94. package/dist/chunks/rune-XRREUL56.js +0 -186
  95. package/dist/chunks/uninstall-G56DZRFG.js +0 -49
@@ -1,186 +0,0 @@
1
- import {
2
- loadConfig
3
- } from "./chunk-GSA432UC.js";
4
- import {
5
- computeEffectivePermissions,
6
- getArgsSchema,
7
- getPluginRunePath,
8
- getReplSchema,
9
- getRune,
10
- resolvePluginRune,
11
- resolveRuneFromPlugins
12
- } from "./chunk-WJRZN7BR.js";
13
- import "./chunk-J3GZ3DXD.js";
14
- import "./chunk-ZJDKCC2Y.js";
15
- import "./chunk-NDEYEYSU.js";
16
- import "./chunk-G4ZAUHHA.js";
17
- import "./chunk-63H5VXZY.js";
18
- import {
19
- formatHelp
20
- } from "./chunk-ASZKAC24.js";
21
- import {
22
- output
23
- } from "./chunk-6XLT25GS.js";
24
- import "./chunk-WCODTMDN.js";
25
- import "./chunk-GTCPZ22N.js";
26
- import "./chunk-6MRZXASS.js";
27
- import {
28
- loadPluginJson
29
- } from "./chunk-G3U4V32O.js";
30
- import {
31
- init_require_shim
32
- } from "./chunk-TPK5AGRA.js";
33
-
34
- // src/docs/commands/rune.js
35
- init_require_shim();
36
- import { join, relative } from "node:path";
37
- var SUGGESTIONS = {
38
- run: "crunes docs run",
39
- args: "crunes docs args",
40
- intro: "crunes docs intro",
41
- utils: "crunes docs utils",
42
- globals: "crunes docs globals"
43
- };
44
- function formatSlashCommands(commands, indent = "") {
45
- const lines = [`${indent}REPL Slash Commands:`];
46
- for (const cmd of commands) {
47
- lines.push(`${indent} /${cmd.name.padEnd(12)} ${cmd.description ?? ""}`);
48
- for (const pos of cmd.positionals ?? []) {
49
- lines.push(`${indent} ${pos.spec.padEnd(14)} ${pos.description ?? ""}`);
50
- }
51
- for (const opt of cmd.options ?? []) {
52
- lines.push(`${indent} ${opt.flags.padEnd(14)} ${opt.description ?? ""}`);
53
- }
54
- }
55
- return lines.join("\n");
56
- }
57
- function formatBatch(batch) {
58
- const lines = ["Batch:"];
59
- if (!batch) {
60
- lines.push(" (not permitted \u2014 no batch block declared)");
61
- return lines.join("\n");
62
- }
63
- const allow = batch.allow ?? [];
64
- const deny = batch.deny ?? [];
65
- lines.push(` allow: ${allow.length ? allow.join(", ") : "(none)"}`);
66
- if (deny.length) lines.push(` deny: ${deny.join(", ")}`);
67
- return lines.join("\n");
68
- }
69
- async function handler({ keys, format = "text", projectRoot = process.cwd(), configRoot = projectRoot }) {
70
- let config;
71
- try {
72
- config = loadConfig(configRoot);
73
- } catch (err) {
74
- output.error(`Config unreadable: ${err.message}`);
75
- process.exit(1);
76
- }
77
- const results = [];
78
- let anyFailed = false;
79
- for (const key of keys) {
80
- let pluginMatch;
81
- try {
82
- pluginMatch = await resolvePluginRune(config, key);
83
- } catch (err) {
84
- output.warn(err.message);
85
- anyFailed = true;
86
- continue;
87
- }
88
- const localEntry = pluginMatch ? null : getRune(config, key);
89
- let autoMatch = null;
90
- if (!pluginMatch && !localEntry) {
91
- try {
92
- autoMatch = await resolveRuneFromPlugins(config, key);
93
- } catch (err) {
94
- output.warn(err.message);
95
- anyFailed = true;
96
- continue;
97
- }
98
- }
99
- const resolved = pluginMatch ?? autoMatch;
100
- if (!localEntry && !resolved) {
101
- if (SUGGESTIONS[key]) {
102
- output.warn(`Unknown rune: "${key}". (Tip: Did you mean "${SUGGESTIONS[key]}"?)`);
103
- } else {
104
- output.warn(`Unknown rune: "${key}"`);
105
- }
106
- anyFailed = true;
107
- continue;
108
- }
109
- let runeFile, relativePath, basePerms, vars, displayName, displayDescription, batch;
110
- if (resolved) {
111
- const { runeKey, pluginDir } = resolved;
112
- let pluginJson;
113
- try {
114
- pluginJson = await loadPluginJson(pluginDir);
115
- } catch (err) {
116
- output.warn(`Could not load plugin for "${key}": ${err.message}`);
117
- anyFailed = true;
118
- continue;
119
- }
120
- const runeDef = pluginJson.runes[runeKey] ?? {};
121
- runeFile = getPluginRunePath(pluginDir, runeKey, pluginJson);
122
- relativePath = void 0;
123
- basePerms = runeDef.permissions ?? { allow: [], deny: [] };
124
- vars = runeDef.vars ?? {};
125
- displayName = runeDef.name ?? runeKey;
126
- displayDescription = runeDef.description ?? null;
127
- batch = runeDef.batch != null ? { allow: runeDef.batch.allow ?? [], deny: runeDef.batch.deny ?? [] } : null;
128
- } else {
129
- runeFile = join(configRoot, localEntry.path ?? `.crunes/runes/${key}.js`);
130
- relativePath = relative(projectRoot, runeFile).replace(/\\/g, "/");
131
- basePerms = localEntry.permissions ?? { allow: [], deny: [] };
132
- vars = localEntry.vars ?? {};
133
- displayName = localEntry.name ?? key;
134
- displayDescription = localEntry.description ?? null;
135
- batch = localEntry.batch != null ? { allow: localEntry.batch.allow ?? [], deny: localEntry.batch.deny ?? [] } : null;
136
- }
137
- const runEffective = computeEffectivePermissions(basePerms, void 0, "run");
138
- const replEffective = computeEffectivePermissions(basePerms, void 0, "repl");
139
- let schema = null;
140
- try {
141
- schema = await getArgsSchema(runeFile, runEffective, projectRoot, { vars, runeKey: key });
142
- } catch (err) {
143
- output.warn(`Could not load args schema for "${key}": ${err.message}`);
144
- }
145
- let repl = null;
146
- try {
147
- const { argsSchema, commandsSchema } = await getReplSchema(runeFile, replEffective, [], projectRoot, { vars, runeKey: key });
148
- if (argsSchema !== null || commandsSchema !== null) {
149
- repl = { argsSchema, commandsSchema };
150
- }
151
- } catch (err) {
152
- output.warn(`Could not load REPL schema for "${key}": ${err.message}`);
153
- }
154
- results.push({
155
- key,
156
- name: displayName,
157
- description: displayDescription,
158
- relativePath,
159
- schema,
160
- repl,
161
- batch
162
- });
163
- }
164
- if (format === "json") {
165
- process.stdout.write(JSON.stringify(results, null, 2) + "\n");
166
- } else {
167
- const blocks = [];
168
- for (const r of results) {
169
- const parts = [];
170
- parts.push(formatHelp(r.schema, { key: r.key, name: r.name, description: r.description, relativePath: r.relativePath }));
171
- if (r.repl?.argsSchema) {
172
- parts.push(formatHelp(r.repl.argsSchema, { key: r.key, name: r.name, description: r.description, relativePath: r.relativePath, lifecycle: "repl" }));
173
- }
174
- if (r.repl?.commandsSchema?.commands?.length) {
175
- parts.push(formatSlashCommands(r.repl.commandsSchema.commands));
176
- }
177
- parts.push(formatBatch(r.batch));
178
- blocks.push(parts.join("\n\n"));
179
- }
180
- if (blocks.length > 0) process.stdout.write(blocks.join("\n\n") + "\n");
181
- }
182
- if (anyFailed) process.exit(1);
183
- }
184
- export {
185
- handler
186
- };
@@ -1,49 +0,0 @@
1
- import {
2
- uninstallPlugin
3
- } from "./chunk-KII6KW5Z.js";
4
- import {
5
- R,
6
- fe,
7
- ge,
8
- le
9
- } from "./chunk-CGZL5SSH.js";
10
- import {
11
- loadRegistry,
12
- resolvePluginKey
13
- } from "./chunk-GTCPZ22N.js";
14
- import "./chunk-6MRZXASS.js";
15
- import "./chunk-G3U4V32O.js";
16
- import {
17
- init_require_shim
18
- } from "./chunk-TPK5AGRA.js";
19
-
20
- // src/plugin/commands/uninstall.js
21
- init_require_shim();
22
- async function handler({ name, yes, projectRoot, configRoot }) {
23
- let pluginKey;
24
- try {
25
- const registry = await loadRegistry();
26
- pluginKey = resolvePluginKey(name, registry);
27
- if (!pluginKey) throw new Error(`Plugin "${name}" is not installed. Run: crunes plugin list`);
28
- } catch (err) {
29
- ge(`Error: ${err.message}`);
30
- process.exit(1);
31
- }
32
- if (!yes) {
33
- const confirm = await le({ message: `Uninstall plugin "${pluginKey}"?` });
34
- if (R(confirm) || !confirm) {
35
- ge("Cancelled.");
36
- process.exit(0);
37
- }
38
- }
39
- try {
40
- await uninstallPlugin(pluginKey, configRoot ?? projectRoot);
41
- fe(`Uninstalled ${pluginKey}`);
42
- } catch (err) {
43
- ge(`Failed: ${err.message}`);
44
- process.exit(1);
45
- }
46
- }
47
- export {
48
- handler
49
- };