@darkrymit/crunes-cli 0.9.0 → 0.10.1
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/chunks/add-2OM5KGN5.js +67 -0
- package/dist/chunks/{apply-YY7MIM64.js → apply-GBUQQ4XF.js} +21 -9
- package/dist/chunks/{benchmark-BQNMULOO.js → benchmark-QWGVX3BX.js} +21 -15
- package/dist/chunks/chunk-2DNYVKBF.js +109 -0
- package/dist/chunks/chunk-2HM5Q52B.js +131 -0
- package/dist/chunks/chunk-3KKRNQQU.js +275 -0
- package/dist/chunks/chunk-55GTJG5I.js +1154 -0
- package/dist/chunks/chunk-7KYCYDAS.js +325 -0
- package/dist/chunks/{chunk-SNC7AOT7.js → chunk-AL37NFWR.js} +45 -94
- package/dist/chunks/chunk-ARIFLX5E.js +9525 -0
- package/dist/chunks/{chunk-X7PZN73N.js → chunk-E7CZPAM2.js} +1 -1
- package/dist/chunks/chunk-EO3CSXWK.js +70 -0
- package/dist/chunks/chunk-FIAFVIAN.js +79 -0
- package/dist/chunks/{chunk-MRNZFUXZ.js → chunk-KQMTTEJV.js} +22 -7
- package/dist/chunks/chunk-KX6QEHM5.js +578 -0
- package/dist/chunks/{chunk-VST6HAB6.js → chunk-MTJ2KW3V.js} +2 -0
- package/dist/chunks/chunk-MUWDZJN2.js +71 -0
- package/dist/chunks/{chunk-CY6C6ADU.js → chunk-MVCBPI4J.js} +45 -478
- package/dist/chunks/{chunk-34F4ZURL.js → chunk-NJVPLN5D.js} +29 -12
- package/dist/chunks/chunk-UBCAZGLE.js +15 -0
- package/dist/chunks/chunk-VP7YLCQP.js +244 -0
- package/dist/chunks/chunk-VSMAZISQ.js +303 -0
- package/dist/chunks/chunk-WE4HDHFU.js +37 -0
- package/dist/chunks/{create-ET6DT5ZE.js → create-2CQZF53Z.js} +5 -2
- package/dist/chunks/{create-LM7U3CJS.js → create-36F6V4WP.js} +99 -6
- package/dist/chunks/{create-TLPM7HJE.js → create-DXW4YYLJ.js} +5 -5
- package/dist/chunks/{disable-TNTEIAKO.js → disable-FB64CSYV.js} +5 -2
- package/dist/chunks/doctor-PVO4JLYN.js +208 -0
- package/dist/chunks/{enable-GUQCB4CU.js → enable-UVXHTKCJ.js} +6 -3
- package/dist/chunks/{init-PJSCFOC6.js → init-GPNC7TR5.js} +5 -2
- package/dist/chunks/{install-4YP7FALO.js → install-3G7U5ZIO.js} +10 -5
- package/dist/chunks/{intro-SA7MWV3Z.js → intro-YI5HUZCF.js} +45 -19
- package/dist/chunks/{list-WKNPZZOV.js → list-J2UCBYAY.js} +9 -6
- package/dist/chunks/list-JB4447YK.js +62 -0
- package/dist/chunks/{list-7R6NASFI.js → list-W4JAYPAA.js} +19 -19
- package/dist/chunks/{manifest-7RVNKBOH.js → manifest-76MIEL2F.js} +3 -1
- package/dist/chunks/{registry-K5DV5NAK.js → registry-IWP7JMNI.js} +1 -1
- package/dist/chunks/{repl-ZB3DIJ4K.js → repl-MWFEZ65P.js} +30 -20
- package/dist/chunks/resolver-URPQMOIV.js +36 -0
- package/dist/chunks/{run-22B65ZWZ.js → run-3VKWSRLO.js} +17 -11
- package/dist/chunks/rune-L5EP645W.js +283 -0
- package/dist/chunks/runner-VPTLUQJE.js +34 -0
- package/dist/chunks/{shell-explain-QLITLHW7.js → shell-explain-LKBBP2BG.js} +5 -2
- package/dist/chunks/trust-LXXYSF6W.js +109 -0
- package/dist/chunks/{uninstall-4WR5IHLC.js → uninstall-J7JUYETA.js} +10 -5
- package/dist/chunks/{update-ACLDK6E6.js → update-ZJRLDCUT.js} +10 -5
- package/dist/chunks/{version-EULYWNXN.js → version-ZULO6CV3.js} +2 -2
- package/dist/cli.js +47 -34
- package/package.json +2 -2
- package/dist/chunks/chunk-G3U4V32O.js +0 -46
- package/dist/chunks/chunk-QYRF3R35.js +0 -154
- package/dist/chunks/chunk-YXCHIMLW.js +0 -75308
- package/dist/chunks/doctor-VXAQYMTR.js +0 -101
- package/dist/chunks/list-OMMZAQ23.js +0 -28
- package/dist/chunks/resolver-QIYYFIDX.js +0 -34
- package/dist/chunks/rune-SYK4N642.js +0 -425
- package/dist/chunks/{delete-5R3WBLVD.js → delete-2EXPFBFC.js} +4 -4
- package/dist/chunks/{delete-U4STA2QZ.js → delete-MJAECXXV.js} +4 -4
|
@@ -2519,12 +2519,12 @@ async function compileIntro() {
|
|
|
2519
2519
|
lines.push("");
|
|
2520
2520
|
lines.push("Crunes execute inside an isolated sandbox (`isolated-vm`). Runes are ESM modules with two primary execution modes: **run** (one-shot) and **repl** (interactive session).");
|
|
2521
2521
|
lines.push("");
|
|
2522
|
-
lines.push("Scaffold a new rune with `crunes create`. In non-interactive/agent sessions `--format` is required (no default); `--path` defaults to `.crunes/runes/<key>.js` if omitted. `-y`/`--yes` is a global flag, so it goes **before** the subcommand:");
|
|
2522
|
+
lines.push("Scaffold a new rune with `crunes create`. In non-interactive/agent sessions `--format` is required (no default); `--path` defaults to `.crunes/runes/<key>.rune.js` if omitted \u2014 the `.rune.js` suffix is what runs a file in the isolate. `-y`/`--yes` is a global flag, so it goes **before** the subcommand:");
|
|
2523
2523
|
lines.push("```bash");
|
|
2524
2524
|
lines.push("crunes -y create my-rune --format markdown");
|
|
2525
2525
|
lines.push("```");
|
|
2526
2526
|
lines.push("");
|
|
2527
|
-
lines.push("`crunes create` does not write a `permissions` block. Grants live in `.crunes/config.json` under `runes.<key>.permissions
|
|
2527
|
+
lines.push("`crunes create` does not write a `permissions` block. Grants live in `.crunes/config.json` under `runes.<key>.run.permissions.allow` \u2014 not in the rune file \u2014 so add them there once you know what the rune touches (section 3).");
|
|
2528
2528
|
lines.push("");
|
|
2529
2529
|
lines.push('**Run mode** \u2014 export `args` to declare a schema and `run` to execute. `--help`/`-h` is NOT intercepted by `crunes run` \u2014 declare it yourself and check it at the top of `run(args)`, as shown below. This example also shows `args(builder)` reading `vars` at schema-build time to compute a dynamic option (`--profile`), a common pattern for anything with a "profile"/"environment" concept:');
|
|
2530
2530
|
lines.push("");
|
|
@@ -2633,39 +2633,38 @@ async function compileIntro() {
|
|
|
2633
2633
|
lines.push("");
|
|
2634
2634
|
lines.push("Configuration properties in `.crunes/config.json` control permissions, default variables, mappings, and plugin registration.");
|
|
2635
2635
|
lines.push("");
|
|
2636
|
-
lines.push("`crunes init` also scaffolds a `.crunes/.gitignore` covering local-only files (`config.local.json`, `project.local.json`) and generated directories (`logs/`, `caches/`, `schemas/`, `sqlite/`, `jobs/`) \u2014 only `config.json` and your rune `.js` files need to be committed.");
|
|
2636
|
+
lines.push("`crunes init` also scaffolds a `.crunes/.gitignore` covering local-only files (`config.local.json`, `project.local.json`) and generated directories (`logs/`, `caches/`, `schemas/`, `sqlite/`, `jobs/`) \u2014 only `config.json` and your rune `.rune.js` files need to be committed.");
|
|
2637
2637
|
lines.push("");
|
|
2638
2638
|
lines.push("### Sandbox Security & Permissions");
|
|
2639
|
-
lines.push("Runes do not have direct access to Node.js APIs.
|
|
2639
|
+
lines.push("Runes do not have direct access to Node.js APIs. A rune entry names its module in a `run` block, and the grants for it inside that block in `.crunes/config.json`. Nothing is found by convention: a rune runs only the module its entry names.");
|
|
2640
2640
|
lines.push("```json");
|
|
2641
2641
|
lines.push("{");
|
|
2642
2642
|
lines.push(' "runes": {');
|
|
2643
2643
|
lines.push(' "my-rune": {');
|
|
2644
2644
|
lines.push(' "name": "My Rune",');
|
|
2645
2645
|
lines.push(' "description": "Does something useful",');
|
|
2646
|
-
lines.push(' "path": ".crunes/runes/my-rune.js",');
|
|
2647
2646
|
lines.push(' "vars": { "api_url": "https://example.com" },');
|
|
2648
|
-
lines.push(' "
|
|
2649
|
-
lines.push(' "
|
|
2647
|
+
lines.push(' "run": {');
|
|
2648
|
+
lines.push(' "command": ".crunes/runes/my-rune.rune.js",');
|
|
2649
|
+
lines.push(' "permissions": { "allow": ["fs.read:src/**", "fs.write:dist/**", "shell.run:git *"] }');
|
|
2650
2650
|
lines.push(" }");
|
|
2651
2651
|
lines.push(" }");
|
|
2652
2652
|
lines.push(" }");
|
|
2653
2653
|
lines.push("}");
|
|
2654
2654
|
lines.push("```");
|
|
2655
2655
|
lines.push("");
|
|
2656
|
-
lines.push("
|
|
2656
|
+
lines.push("A rune has a REPL only when its entry declares a `repl` block, with its own grants \u2014 `repl` does not inherit from `run`:");
|
|
2657
2657
|
lines.push("```json");
|
|
2658
2658
|
lines.push("{");
|
|
2659
2659
|
lines.push(' "runes": {');
|
|
2660
2660
|
lines.push(' "my-shell": {');
|
|
2661
|
-
lines.push(' "permissions": {');
|
|
2662
|
-
lines.push('
|
|
2663
|
-
lines.push(' "repl": { "allow": ["sqlite.read:./state::db", "sqlite.write:./state::db"] }');
|
|
2664
|
-
lines.push(" }");
|
|
2661
|
+
lines.push(' "run": { "command": ".crunes/runes/my-shell.rune.js", "permissions": { "allow": ["sqlite.read:./state::db"] } },');
|
|
2662
|
+
lines.push(' "repl": { "command": ".crunes/runes/my-shell.rune.js", "permissions": { "allow": ["sqlite.read:./state::db", "sqlite.write:./state::db"] } }');
|
|
2665
2663
|
lines.push(" }");
|
|
2666
2664
|
lines.push(" }");
|
|
2667
2665
|
lines.push("}");
|
|
2668
2666
|
lines.push("```");
|
|
2667
|
+
lines.push('A block written as a string is shorthand for `{ "command": \u2026 }`.');
|
|
2669
2668
|
lines.push("");
|
|
2670
2669
|
lines.push('To grant a **plugin** rune extra permissions or vars from the project side (plugin runes have no `runes.<key>` entry of their own), add an entry keyed by the fully-qualified `"marketplace@plugin:runeKey"` string \u2014 **this must always be the full form, never the bare plugin name**, since two enabled plugins could share a bare name and a bare-form key can never resolve to anything (config loading rejects a bare-form key outright).');
|
|
2671
2670
|
lines.push("```json");
|
|
@@ -2674,8 +2673,8 @@ async function compileIntro() {
|
|
|
2674
2673
|
lines.push(' "runes": {');
|
|
2675
2674
|
lines.push(' "my-market@my-plugin:deploy": {');
|
|
2676
2675
|
lines.push(' "vars": { "region": "us-east-1" },');
|
|
2677
|
-
lines.push(' "
|
|
2678
|
-
lines.push(' "
|
|
2676
|
+
lines.push(' "run": {');
|
|
2677
|
+
lines.push(' "permissions": { "allow": ["fs.read:src/**"] }');
|
|
2679
2678
|
lines.push(" }");
|
|
2680
2679
|
lines.push(" }");
|
|
2681
2680
|
lines.push(" }");
|
|
@@ -2695,9 +2694,36 @@ async function compileIntro() {
|
|
|
2695
2694
|
lines.push("```");
|
|
2696
2695
|
lines.push("Now `crunes run git` always resolves to that specific plugin rune, with no ambiguity, regardless of what else is enabled.");
|
|
2697
2696
|
lines.push("");
|
|
2697
|
+
lines.push("### Script Runes");
|
|
2698
|
+
lines.push("A rune can also be a Node, Python or bash script, or a program on `PATH`. Its `run` block names the script instead of a `*.rune.js` module \u2014 `crunes add <key> <command>` writes one:");
|
|
2699
|
+
lines.push("```json");
|
|
2700
|
+
lines.push("{");
|
|
2701
|
+
lines.push(' "runes": {');
|
|
2702
|
+
lines.push(' "coverage": { "description": "Coverage per module", "run": "tools/coverage.py", "args": ".crunes/runes/coverage.args.rune.js" },');
|
|
2703
|
+
lines.push(' "log": { "description": "Recent commits", "run": { "command": "git", "argv": ["log", "--oneline", "-n", "20"] } },');
|
|
2704
|
+
lines.push(' "api": { "run": { "command": ".crunes/runes/api.rune.js", "permissions": { "allow": ["fs.read:src/**"] } } }');
|
|
2705
|
+
lines.push(" }");
|
|
2706
|
+
lines.push("}");
|
|
2707
|
+
lines.push("```");
|
|
2708
|
+
lines.push("- **`run.command`** is resolved like a shell resolves a command: a value with a path separator, a leading `.`, or an absolute path is a file relative to the config layer; a bare name is a program on `PATH`. A file name selects the runtime: `*.rune.js` runs in the isolate, `.js`/`.mjs`/`.cjs` with Node, `.py` with Python (`CRUNES_PYTHON`, the active virtualenv, a project `.venv/` or `venv/`, then `python3`/`python`), `.sh` with bash; anything else is executed directly. `run.argv` is placed before the caller's arguments.");
|
|
2709
|
+
lines.push("- **Script runes run natively, with full access** \u2014 `run.permissions` is only accepted for a `*.rune.js` module. `crunes list` marks them `native`; `crunes doctor` reports the interpreter each one resolves to.");
|
|
2710
|
+
lines.push("- **A plugin may ship script runes too**, with the same `run` and `args` blocks in its `plugin.json`. Installing the plugin does not make them runnable: each is refused until you review it with `crunes plugin trust <plugin> [rune]`, which shows the command and the script itself and records your trust against exactly that content. A plugin update that changes a script, its command or its schema needs trusting again. Every run of a plugin script says on standard error that it runs natively; the script receives `CRUNES_PLUGIN_ROOT` beside the usual variables.");
|
|
2711
|
+
lines.push("- **`args`** documents and parses a script's arguments: crunes answers `--help`, `crunes docs rune` shows the schema, and the script receives the parsed result as JSON in `CRUNES_ARGS` alongside the raw arguments. It is a JSON schema \u2014 written inline, or in a `.json` file \u2014 or a `*.rune.js` module whose `args(builder)` export builds one. In a JSON schema, an option takes `default`, `required` and `choices`, a positional takes `choices`, and either takes `type` (`string`, `number` or `integer`; values are strings unless declared otherwise); crunes refuses a call that is missing a required argument, uses a value outside its choices, or is not of the declared type, before the script starts. Without an `args` block, arguments pass through unchanged.");
|
|
2712
|
+
lines.push("- **`run.timeout`** \u2014 seconds a rune may run. A script still running is stopped (SIGTERM, then SIGKILL five seconds later, with the processes it started) and ends with status 124 when run on its own, or fails the rune when captured; an isolate module's timeout replaces the default 30 seconds. A script has no timeout unless its entry declares one.");
|
|
2713
|
+
lines.push('- **`run.pass: "mapped"`** makes the schema the rune\'s whole surface: a call with an option or argument the schema does not declare is refused, and the parsed call is rewritten into the program\'s own arguments instead of being passed raw. Each positional, option or command may declare `to` \u2014 the program tokens it becomes, with `{value}` for its value, e.g. `{ "flags": "--limit <n>", "type": "integer", "to": ["-n", "{value}"] }`; without `to`, an option is passed as its own flag. The order is `run.argv`, the matched command path, the options as declared, then the positionals.');
|
|
2714
|
+
lines.push("```json");
|
|
2715
|
+
lines.push('"args": {');
|
|
2716
|
+
lines.push(' "positionals": [{ "spec": "<module>", "description": "Module to report on", "choices": ["auth", "billing"] }],');
|
|
2717
|
+
lines.push(' "options": [{ "flags": "--min <percent>", "description": "Fail below this", "default": "0" }]');
|
|
2718
|
+
lines.push("}");
|
|
2719
|
+
lines.push("```");
|
|
2720
|
+
lines.push('- **`run.output: "sections"`** lets a script print named sections: each standard-output line shaped like a `--format jsonl` section event \u2014 `{"type":"section","section":{"name":"summary","data":{"type":"markdown","content":"\u2026"}}}` \u2014 becomes a section as soon as it is printed, filterable with `-s`; any other line is plain text. Run on its own, a script\'s sections print as markdown; in a batch or JSONL they are labelled like any rune\'s.');
|
|
2721
|
+
lines.push("- **`crunes create --lang python|bash|node <key>`** scaffolds a script rune; `crunes add <key> <command>` registers one that already exists.");
|
|
2722
|
+
lines.push("- **Run on its own, a script rune gets the caller's terminal and standard streams and returns its own exit code.** In a batch, `--format jsonl` or `rune.exec`, its standard output is captured as an `output` section and a non-zero exit fails it. Every script also receives `CRUNES_PROJECT_ROOT`, `CRUNES_RUNE_KEY`, `CRUNES_LIFECYCLE`, and `CRUNES_VARS` \u2014 the rune's configured `vars` as a JSON object.");
|
|
2723
|
+
lines.push("");
|
|
2698
2724
|
lines.push("### Config File Fields Reference");
|
|
2699
|
-
lines.push('- **`runes`**: Definition of project-registered runes, keyed by rune key (or the fully-qualified `"marketplace@plugin:runeKey"` string for a plugin-rune override \u2014 never a bare plugin name). Each entry
|
|
2700
|
-
lines.push('- **`plugins`**: Map of plugin key to a boolean, e.g. `{"my-market@my-plugin": true}`.
|
|
2725
|
+
lines.push('- **`runes`**: Definition of project-registered runes, keyed by rune key (or the fully-qualified `"marketplace@plugin:runeKey"` string for a plugin-rune override \u2014 never a bare plugin name). Each entry declares a `run` block (and optionally `args` \u2014 see Script Runes \u2014 and `repl`), `name`, `description` and `vars` (key-value settings read via `utils.vars.read(key)`); or `plugin` (an alias to a specific plugin rune, see above). Grants live inside the `run` and `repl` blocks as `{ "allow": [...], "deny": [...] }`; a plugin alias or `marketplace@plugin:rune` override may carry blocks with only `permissions`.');
|
|
2726
|
+
lines.push('- **`plugins`**: Map of plugin key to a boolean, e.g. `{"my-market@my-plugin": true}`. `false` is meaningful: it turns a plugin off in this layer even though a lower layer enabled it.');
|
|
2701
2727
|
lines.push("- **`templates`**: Definition of registered templates, keyed by template name, merged across layers exactly like `runes`.");
|
|
2702
2728
|
lines.push("");
|
|
2703
2729
|
lines.push("### Config Layers");
|
|
@@ -2707,10 +2733,10 @@ async function compileIntro() {
|
|
|
2707
2733
|
lines.push("2. <project>/.crunes/config.json");
|
|
2708
2734
|
lines.push("3. <project>/.crunes/config.local.json");
|
|
2709
2735
|
lines.push("```");
|
|
2710
|
-
lines.push("`~/.crunes` **is** the global config directory, so global paths carry no `.crunes/` segment: a global rune
|
|
2736
|
+
lines.push("`~/.crunes` **is** the global config directory, so global paths carry no `.crunes/` segment: a global rune's module is written `runes/<key>.rune.js` and lives at `~/.crunes/runes/<key>.rune.js`. Each layer resolves its own files before merging, so a project can override one field of a global rune and still load the global file:");
|
|
2711
2737
|
lines.push("```json");
|
|
2712
2738
|
lines.push("// ~/.crunes/config.json");
|
|
2713
|
-
lines.push('{ "runes": { "serve": { "
|
|
2739
|
+
lines.push('{ "runes": { "serve": { "run": "runes/serve.rune.js", "vars": { "port": 3000 } } } }');
|
|
2714
2740
|
lines.push("");
|
|
2715
2741
|
lines.push("// <project>/.crunes/config.json \u2014 same rune, different port");
|
|
2716
2742
|
lines.push('{ "runes": { "serve": { "vars": { "port": 4000 } } } }');
|
|
@@ -2730,7 +2756,7 @@ async function compileIntro() {
|
|
|
2730
2756
|
lines.push("`-g` / `--global` targets the global config instead of the project:");
|
|
2731
2757
|
lines.push("```bash");
|
|
2732
2758
|
lines.push("crunes init -g # create ~/.crunes/config.json");
|
|
2733
|
-
lines.push("crunes create -g serve # write ~/.crunes/runes/serve.js and register it");
|
|
2759
|
+
lines.push("crunes create -g serve # write ~/.crunes/runes/serve.rune.js and register it");
|
|
2734
2760
|
lines.push("crunes plugin install -g mkt@plug # install and enable everywhere");
|
|
2735
2761
|
lines.push("crunes plugin enable -g plug");
|
|
2736
2762
|
lines.push("crunes plugin disable plug # opt this project out of a global enable");
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_cli_table3
|
|
3
3
|
} from "./chunk-DMMC4X27.js";
|
|
4
|
-
import {
|
|
5
|
-
loadConfig
|
|
6
|
-
} from "./chunk-QYRF3R35.js";
|
|
7
4
|
import {
|
|
8
5
|
output
|
|
9
6
|
} from "./chunk-MIKWIFYR.js";
|
|
10
7
|
import "./chunk-CGZL5SSH.js";
|
|
11
8
|
import "./chunk-WCODTMDN.js";
|
|
9
|
+
import {
|
|
10
|
+
loadConfig
|
|
11
|
+
} from "./chunk-3KKRNQQU.js";
|
|
12
|
+
import "./chunk-UBCAZGLE.js";
|
|
12
13
|
import {
|
|
13
14
|
loadRegistry
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-2Q3KLBE6.js";
|
|
15
|
+
} from "./chunk-MTJ2KW3V.js";
|
|
16
16
|
import {
|
|
17
17
|
loadPluginJson
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FIAFVIAN.js";
|
|
19
|
+
import "./chunk-VP7YLCQP.js";
|
|
20
|
+
import "./chunk-2Q3KLBE6.js";
|
|
21
|
+
import "./chunk-55GTJG5I.js";
|
|
19
22
|
import {
|
|
20
23
|
__toESM,
|
|
21
24
|
init_require_shim
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isNativeRune
|
|
3
|
+
} from "./chunk-MUWDZJN2.js";
|
|
4
|
+
import {
|
|
5
|
+
loadConfig
|
|
6
|
+
} from "./chunk-3KKRNQQU.js";
|
|
7
|
+
import "./chunk-UBCAZGLE.js";
|
|
8
|
+
import {
|
|
9
|
+
loadRegistry
|
|
10
|
+
} from "./chunk-MTJ2KW3V.js";
|
|
11
|
+
import {
|
|
12
|
+
loadPluginJson
|
|
13
|
+
} from "./chunk-FIAFVIAN.js";
|
|
14
|
+
import "./chunk-VP7YLCQP.js";
|
|
15
|
+
import "./chunk-WE4HDHFU.js";
|
|
16
|
+
import "./chunk-2Q3KLBE6.js";
|
|
17
|
+
import "./chunk-55GTJG5I.js";
|
|
18
|
+
import {
|
|
19
|
+
init_require_shim
|
|
20
|
+
} from "./chunk-TPK5AGRA.js";
|
|
21
|
+
|
|
22
|
+
// src/plugin/commands/list.js
|
|
23
|
+
init_require_shim();
|
|
24
|
+
async function handler({ format = "md", projectRoot = process.cwd() } = {}) {
|
|
25
|
+
const registry = await loadRegistry();
|
|
26
|
+
const plugins = Object.entries(registry.plugins ?? {});
|
|
27
|
+
if (plugins.length === 0) {
|
|
28
|
+
console.log("No plugins installed.");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (format === "json") {
|
|
32
|
+
console.log(JSON.stringify(registry.plugins, null, 2));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let enabledKeys = /* @__PURE__ */ new Set();
|
|
36
|
+
try {
|
|
37
|
+
const config = await loadConfig(projectRoot);
|
|
38
|
+
for (const [k, v] of Object.entries(config.plugins ?? {})) {
|
|
39
|
+
if (v) enabledKeys.add(k);
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
for (const [key, entry] of plugins) {
|
|
44
|
+
const isEnabled = enabledKeys.has(key);
|
|
45
|
+
let hasNative = false;
|
|
46
|
+
try {
|
|
47
|
+
if (entry.path) {
|
|
48
|
+
const pj = await loadPluginJson(entry.path);
|
|
49
|
+
hasNative = Object.values(pj.runes ?? {}).some((r) => isNativeRune(r));
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
const tags = [];
|
|
54
|
+
if (isEnabled) tags.push("[enabled]");
|
|
55
|
+
if (hasNative) tags.push("(native runes)");
|
|
56
|
+
const tagStr = tags.length ? ` ${tags.join(" ")}` : "";
|
|
57
|
+
console.log(`${key} v${entry.version}${tagStr}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
handler
|
|
62
|
+
};
|
|
@@ -3,27 +3,26 @@ import {
|
|
|
3
3
|
} from "./chunk-DMMC4X27.js";
|
|
4
4
|
import {
|
|
5
5
|
enumerateRunes
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-YXCHIMLW.js";
|
|
8
|
-
import "./chunk-UEUUOAJY.js";
|
|
9
|
-
import "./chunk-4GJMCFR6.js";
|
|
10
|
-
import "./chunk-CY6C6ADU.js";
|
|
11
|
-
import "./chunk-GVMT55GH.js";
|
|
12
|
-
import "./chunk-WJII3LZK.js";
|
|
13
|
-
import "./chunk-G4ZAUHHA.js";
|
|
14
|
-
import {
|
|
15
|
-
LAYER,
|
|
16
|
-
ROOTLESS,
|
|
17
|
-
loadConfig
|
|
18
|
-
} from "./chunk-QYRF3R35.js";
|
|
6
|
+
} from "./chunk-KQMTTEJV.js";
|
|
19
7
|
import {
|
|
20
8
|
output
|
|
21
9
|
} from "./chunk-MIKWIFYR.js";
|
|
22
10
|
import "./chunk-CGZL5SSH.js";
|
|
23
11
|
import "./chunk-WCODTMDN.js";
|
|
24
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-2DNYVKBF.js";
|
|
13
|
+
import "./chunk-MUWDZJN2.js";
|
|
14
|
+
import {
|
|
15
|
+
LAYER,
|
|
16
|
+
ROOTLESS,
|
|
17
|
+
loadConfig
|
|
18
|
+
} from "./chunk-3KKRNQQU.js";
|
|
19
|
+
import "./chunk-UBCAZGLE.js";
|
|
20
|
+
import "./chunk-MTJ2KW3V.js";
|
|
21
|
+
import "./chunk-VP7YLCQP.js";
|
|
22
|
+
import "./chunk-WE4HDHFU.js";
|
|
23
|
+
import "./chunk-2HM5Q52B.js";
|
|
25
24
|
import "./chunk-2Q3KLBE6.js";
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-55GTJG5I.js";
|
|
27
26
|
import {
|
|
28
27
|
__toESM,
|
|
29
28
|
init_require_shim
|
|
@@ -67,9 +66,10 @@ async function handler({
|
|
|
67
66
|
process.stdout.write(JSON.stringify(entries, null, 2) + "\n");
|
|
68
67
|
return;
|
|
69
68
|
}
|
|
69
|
+
const shownSource = ({ source, runtime }) => runtime ? `${source} (${runtime === "isolate" ? "isolate" : `${runtime}, native`})` : source;
|
|
70
70
|
if (plain) {
|
|
71
|
-
for (const { key, name, description, source, layer } of entries) {
|
|
72
|
-
process.stdout.write(`${key} ${name ?? ""} ${description ?? ""} ${source} ${layer}
|
|
71
|
+
for (const { key, name, description, source, runtime, layer } of entries) {
|
|
72
|
+
process.stdout.write(`${key} ${name ?? ""} ${description ?? ""} ${shownSource({ source, runtime })} ${layer}
|
|
73
73
|
`);
|
|
74
74
|
}
|
|
75
75
|
return;
|
|
@@ -81,8 +81,8 @@ async function handler({
|
|
|
81
81
|
head: ["Key", "Name", "Description", "Source", "Layer"],
|
|
82
82
|
style: { head: ["cyan"] }
|
|
83
83
|
});
|
|
84
|
-
for (const { key, name, description, source, layer } of entries) {
|
|
85
|
-
table.push([key, name ?? "", description ?? "", source, layer]);
|
|
84
|
+
for (const { key, name, description, source, runtime, layer } of entries) {
|
|
85
|
+
table.push([key, name ?? "", description ?? "", shownSource({ source, runtime }), layer]);
|
|
86
86
|
}
|
|
87
87
|
process.stdout.write(table.toString() + "\n");
|
|
88
88
|
}
|
|
@@ -1,33 +1,43 @@
|
|
|
1
1
|
import {
|
|
2
|
-
formatSection,
|
|
3
2
|
parseSegment,
|
|
4
3
|
permissionHint
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AL37NFWR.js";
|
|
6
5
|
import {
|
|
7
|
-
describeConfigLayers,
|
|
8
|
-
parseArgs,
|
|
9
6
|
tailStdin
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-UEUUOAJY.js";
|
|
12
|
-
import "./chunk-4GJMCFR6.js";
|
|
13
|
-
import {
|
|
14
|
-
isGlobMatch
|
|
15
|
-
} from "./chunk-CY6C6ADU.js";
|
|
16
|
-
import "./chunk-GVMT55GH.js";
|
|
17
|
-
import "./chunk-WJII3LZK.js";
|
|
18
|
-
import "./chunk-G4ZAUHHA.js";
|
|
19
|
-
import {
|
|
20
|
-
loadConfig
|
|
21
|
-
} from "./chunk-QYRF3R35.js";
|
|
7
|
+
} from "./chunk-EO3CSXWK.js";
|
|
22
8
|
import {
|
|
23
9
|
isVerbose,
|
|
24
10
|
output
|
|
25
11
|
} from "./chunk-MIKWIFYR.js";
|
|
26
12
|
import "./chunk-CGZL5SSH.js";
|
|
27
13
|
import "./chunk-WCODTMDN.js";
|
|
28
|
-
import
|
|
14
|
+
import {
|
|
15
|
+
describeConfigLayers
|
|
16
|
+
} from "./chunk-VSMAZISQ.js";
|
|
17
|
+
import {
|
|
18
|
+
formatSection
|
|
19
|
+
} from "./chunk-KX6QEHM5.js";
|
|
20
|
+
import "./chunk-2DNYVKBF.js";
|
|
21
|
+
import "./chunk-MUWDZJN2.js";
|
|
22
|
+
import {
|
|
23
|
+
loadConfig
|
|
24
|
+
} from "./chunk-3KKRNQQU.js";
|
|
25
|
+
import "./chunk-UBCAZGLE.js";
|
|
26
|
+
import "./chunk-MTJ2KW3V.js";
|
|
27
|
+
import "./chunk-FIAFVIAN.js";
|
|
28
|
+
import "./chunk-VP7YLCQP.js";
|
|
29
|
+
import "./chunk-WE4HDHFU.js";
|
|
30
|
+
import {
|
|
31
|
+
isGlobMatch
|
|
32
|
+
} from "./chunk-MVCBPI4J.js";
|
|
33
|
+
import "./chunk-GVMT55GH.js";
|
|
34
|
+
import "./chunk-2HM5Q52B.js";
|
|
35
|
+
import "./chunk-WJII3LZK.js";
|
|
36
|
+
import "./chunk-G4ZAUHHA.js";
|
|
29
37
|
import "./chunk-2Q3KLBE6.js";
|
|
30
|
-
import
|
|
38
|
+
import {
|
|
39
|
+
parseArgs
|
|
40
|
+
} from "./chunk-55GTJG5I.js";
|
|
31
41
|
import {
|
|
32
42
|
init_require_shim
|
|
33
43
|
} from "./chunk-TPK5AGRA.js";
|
|
@@ -147,12 +157,12 @@ async function handler({
|
|
|
147
157
|
output.info("Run `crunes init` to create a config file.");
|
|
148
158
|
process.exit(1);
|
|
149
159
|
}
|
|
150
|
-
const { resolveRuneEntry } = await import("./resolver-
|
|
160
|
+
const { resolveRuneEntry } = await import("./resolver-URPQMOIV.js");
|
|
151
161
|
let runeEntry;
|
|
152
162
|
try {
|
|
153
163
|
runeEntry = await resolveRuneEntry(projectRoot, config, key, configRoot);
|
|
154
164
|
} catch (err) {
|
|
155
|
-
output.error(`
|
|
165
|
+
output.error(`Cannot start a REPL for "${key}": ${err.message}`);
|
|
156
166
|
process.exit(1);
|
|
157
167
|
}
|
|
158
168
|
const instanceId = "1";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
describeConfigLayers,
|
|
3
|
+
resolvePluginRune,
|
|
4
|
+
resolveRuneEntry,
|
|
5
|
+
resolveRuneFromPlugins,
|
|
6
|
+
runRune
|
|
7
|
+
} from "./chunk-VSMAZISQ.js";
|
|
8
|
+
import "./chunk-KX6QEHM5.js";
|
|
9
|
+
import "./chunk-2DNYVKBF.js";
|
|
10
|
+
import "./chunk-MUWDZJN2.js";
|
|
11
|
+
import {
|
|
12
|
+
getRune,
|
|
13
|
+
normaliseRune
|
|
14
|
+
} from "./chunk-3KKRNQQU.js";
|
|
15
|
+
import "./chunk-UBCAZGLE.js";
|
|
16
|
+
import "./chunk-MTJ2KW3V.js";
|
|
17
|
+
import "./chunk-FIAFVIAN.js";
|
|
18
|
+
import "./chunk-VP7YLCQP.js";
|
|
19
|
+
import "./chunk-WE4HDHFU.js";
|
|
20
|
+
import "./chunk-MVCBPI4J.js";
|
|
21
|
+
import "./chunk-GVMT55GH.js";
|
|
22
|
+
import "./chunk-2HM5Q52B.js";
|
|
23
|
+
import "./chunk-WJII3LZK.js";
|
|
24
|
+
import "./chunk-G4ZAUHHA.js";
|
|
25
|
+
import "./chunk-2Q3KLBE6.js";
|
|
26
|
+
import "./chunk-55GTJG5I.js";
|
|
27
|
+
import "./chunk-TPK5AGRA.js";
|
|
28
|
+
export {
|
|
29
|
+
describeConfigLayers,
|
|
30
|
+
getRune,
|
|
31
|
+
normaliseRune,
|
|
32
|
+
resolvePluginRune,
|
|
33
|
+
resolveRuneEntry,
|
|
34
|
+
resolveRuneFromPlugins,
|
|
35
|
+
runRune
|
|
36
|
+
};
|
|
@@ -4,21 +4,27 @@ import {
|
|
|
4
4
|
parseBracketKey,
|
|
5
5
|
parseRunArgs,
|
|
6
6
|
parseSegment
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-YXCHIMLW.js";
|
|
9
|
-
import "./chunk-UEUUOAJY.js";
|
|
10
|
-
import "./chunk-4GJMCFR6.js";
|
|
11
|
-
import "./chunk-CY6C6ADU.js";
|
|
12
|
-
import "./chunk-GVMT55GH.js";
|
|
13
|
-
import "./chunk-WJII3LZK.js";
|
|
14
|
-
import "./chunk-G4ZAUHHA.js";
|
|
15
|
-
import "./chunk-QYRF3R35.js";
|
|
7
|
+
} from "./chunk-AL37NFWR.js";
|
|
16
8
|
import "./chunk-MIKWIFYR.js";
|
|
17
9
|
import "./chunk-CGZL5SSH.js";
|
|
18
10
|
import "./chunk-WCODTMDN.js";
|
|
19
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-VSMAZISQ.js";
|
|
12
|
+
import "./chunk-KX6QEHM5.js";
|
|
13
|
+
import "./chunk-2DNYVKBF.js";
|
|
14
|
+
import "./chunk-MUWDZJN2.js";
|
|
15
|
+
import "./chunk-3KKRNQQU.js";
|
|
16
|
+
import "./chunk-UBCAZGLE.js";
|
|
17
|
+
import "./chunk-MTJ2KW3V.js";
|
|
18
|
+
import "./chunk-FIAFVIAN.js";
|
|
19
|
+
import "./chunk-VP7YLCQP.js";
|
|
20
|
+
import "./chunk-WE4HDHFU.js";
|
|
21
|
+
import "./chunk-MVCBPI4J.js";
|
|
22
|
+
import "./chunk-GVMT55GH.js";
|
|
23
|
+
import "./chunk-2HM5Q52B.js";
|
|
24
|
+
import "./chunk-WJII3LZK.js";
|
|
25
|
+
import "./chunk-G4ZAUHHA.js";
|
|
20
26
|
import "./chunk-2Q3KLBE6.js";
|
|
21
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-55GTJG5I.js";
|
|
22
28
|
import "./chunk-TPK5AGRA.js";
|
|
23
29
|
export {
|
|
24
30
|
handler,
|