fvtt-world-cli 1.0.0 → 1.1.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.
package/README.md CHANGED
@@ -2,24 +2,24 @@
2
2
 
3
3
  [![Foundry VTT v13–v14](https://img.shields.io/badge/Foundry%20VTT-v13%E2%80%93v14-ff6400)](https://foundryvtt.com)
4
4
 
5
- Tell your AI agent what should change in your Foundry VTT world, and it happens in the live
5
+ Tell your AI agent what should change in your Foundry VTT world, and it happens in the live
6
6
  world, validated by Foundry, visible to your players immediately.
7
7
 
8
8
  ```text
9
- You → agent: The scimitar in Valeros's inventory should burn targets on hit
10
- add a Flaming effect to it.”
9
+ You → agent: "The scimitar in Valeros's inventory should burn targets on hit.
10
+ Add a Flaming effect to it."
11
11
 
12
12
  agent → fvtt-world-cli:
13
13
  actor list --name Valeros find the character
14
14
  actor item list --name scimitar find the sword in their inventory
15
15
  actor item effect create … add the effect to it
16
16
 
17
- agent → you: Done Flaming effect added, already live in the world.”
17
+ agent → you: "Done. Flaming effect added, already live in the world."
18
18
  ```
19
19
 
20
20
  Modern agents already understand requests like that. What they have lacked is a safe way into
21
21
  Foundry: driving the browser UI is brittle and token consuming, and editing world files on disk
22
- bypasses everything Foundry does to keep a world consistent. fvtt-world-cli is the missing bridge
22
+ bypasses everything Foundry does to keep a world consistent. fvtt-world-cli is the missing bridge,
23
23
  a command line wired into your open GM session that performs every change through Foundry's own
24
24
  APIs, exactly as if a GM had made it in the UI.
25
25
 
@@ -34,18 +34,18 @@ scenes down to individual tokens, walls, and lights, and pull content in from co
34
34
 
35
35
  A few asks it handles end to end:
36
36
 
37
- - Sort the journals into folders by location.”
38
- - Dim every light in the tavern scene down to torchlight.”
39
- - Find every NPC that still has no portrait and list them.”
40
- - Turn the bestiary goblin into a flying one that throws dynamite for 2d6 damage, and add it to
41
- the scene.”
37
+ - "Sort the journals into folders by location."
38
+ - "Dim every light in the tavern scene down to torchlight."
39
+ - "Find every NPC that still has no portrait and list them."
40
+ - "Turn the bestiary goblin into a flying one that throws dynamite for 2d6 damage, and add it to
41
+ the scene."
42
42
 
43
43
  [Commands](docs/commands.md) maps the full surface.
44
44
 
45
45
  ## Setting up
46
46
 
47
47
  The simplest setup is one step: point your AI agent at this repository and ask it to set
48
- fvtt-world-cli up. Then follow its lead it will most likely ask you to install the module in
48
+ fvtt-world-cli up. Then follow its lead. It will most likely ask you to install the module in
49
49
  Foundry and click *Pair* there, and it handles the rest itself.
50
50
 
51
51
  ### Manual setup
@@ -75,14 +75,14 @@ agent works with the world.
75
75
 
76
76
  4. Pair the browser: choose *Pair* in the module's Authorization window, reachable from the
77
77
  *World CLI* group in the scene controls or from the module's settings. Then approve the request
78
- from the terminal it shows the requesting origin, world, GM, and browser, and asks for a yes
78
+ from the terminal. It shows the requesting origin, world, GM, and browser, and asks for a yes
79
79
  or no:
80
80
 
81
81
  ```bash
82
82
  fvtt-world-cli auth
83
83
  ```
84
84
 
85
- 5. Optionally, install the packaged skill into your AI agent the next section explains what it
85
+ 5. Optionally, install the packaged skill into your AI agent; the next section explains what it
86
86
  does:
87
87
 
88
88
  ```bash
@@ -116,6 +116,8 @@ authority; [Security](docs/security.md) covers the boundaries in full. In short:
116
116
  the UI uses, under the GM's permissions.
117
117
  - Any change can be previewed before it happens: a global `--dry-run` flag runs the same
118
118
  validation and guards as a real call and stops before mutation.
119
+ - Every command has a permission in the active Foundry client: run, ask the GM, or refuse.
120
+ Destructive commands ask the GM by default.
119
121
  - There is no arbitrary-code path: commands are typed and validated on both sides of the transport,
120
122
  and executable content such as scripted region behaviors is blocked on every write route.
121
123
  - File access is confined to the active world's managed assets and always excludes its manifest,
@@ -31,7 +31,19 @@ if (existsSync(compiledEntry) && process.env.FVTT_WORLD_CLI_FORCE_SRC !== "1") {
31
31
  stdio: "inherit"
32
32
  });
33
33
 
34
+ /** @type {NodeJS.Signals[]} */
35
+ const relayedSignals = ["SIGINT", "SIGTERM", "SIGHUP"];
36
+ for (const signal of relayedSignals) {
37
+ process.on(signal, () => {
38
+ child.kill(signal);
39
+ });
40
+ }
41
+
34
42
  child.on("exit", (code, signal) => {
43
+ for (const relayed of relayedSignals) {
44
+ process.removeAllListeners(relayed);
45
+ }
46
+
35
47
  if (signal) {
36
48
  process.kill(process.pid, signal);
37
49
  return;