fvtt-world-cli 1.1.0 → 1.1.2

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.
@@ -1,28 +1,19 @@
1
1
  # Foundry compatibility
2
2
 
3
- The bridge supports Foundry VTT v13 and v14. It capability-checks behavior whose availability or
4
- semantics differ by version and returns a structured error when it cannot provide the documented
5
- result honestly.
3
+ The bridge supports Foundry VTT v13 and v14. Check your connected version with
4
+ `fvtt-world-cli system info --json`.
6
5
 
7
- ## Operator contract
8
-
9
- - `fvtt-world-cli system info --json` reports the connected Foundry, system, module, limits, and
10
- discoverable command inventory.
11
- - `UNSUPPORTED_OPERATION` is a capability result, not a transient transport failure.
12
- - A dry run validates a proposed mutation; it does not forecast values that require execution.
6
+ | Area | v13 | v14 | What to do |
7
+ |---|---|---|---|
8
+ | Measured templates | Available | Removed from core | Use `scene.template` commands on v13. They are unavailable on v14. |
9
+ | Scene thumbnail rendering | Renders the scene | Renders the scene's initial level by default | On v14, expect the initial level in the thumbnail. Check the returned dimensions and image. |
10
+ | Scene thumbnail files | Uses a stable scene-based filename | Uses a filename based on the image content | Use the returned path. On v14, a changed image can leave an older thumbnail file behind. |
11
+ | User permission names | `TEMPLATE_CREATE` | `REGION_CREATE` | Use the permission keys reported by the connected Foundry version when calling `user.permissions.set`. |
13
12
 
14
- ## Known differences
13
+ Scene placeable fields and available region behavior types also differ. Read the target document
14
+ before preparing a patch; valid data from one version is not automatically valid on the other.
15
15
 
16
- | Area | v13 | v14 | CLI behavior |
17
- |---|---|---|---|
18
- | Measured templates | Available | Removed from core | Template commands are capability-gated |
19
- | Scene thumbnail rendering | Whole-scene behavior | Initial-level behavior | Reports the dimensions and stored path actually produced |
20
- | Scene thumbnail files | Stable scene-based filename | Content-derived filenames | Consumers use the returned path; cleanup policy differs |
21
- | Scene placeable fields | Older document models | Some families add fields | Open-family writes pass through sanitized data; reads expose the documented projection |
22
- | Region behaviors | Core v13 type set | Additional core types | Executable core behavior types remain guarded; other types are Foundry-validated |
23
- | Combat and action APIs | Version-specific signatures | Version-specific signatures | The bridge adapts known signatures and refuses unsupported behavior |
24
- | Scene activation | `Scene#activate` runs for any caller | `Scene#activate` throws for non-GM users | The bridge requires GM authority on both versions |
25
- | User permission names | `TEMPLATE_CREATE` | Renamed to `REGION_CREATE` | `user.permissions.set` validates keys against the connected version's live permission set rather than a fixed list |
16
+ ## When an operation is unavailable
26
17
 
27
- This table describes current operator-visible differences, not implementation evidence. Exact
28
- capabilities remain defined by the connected bridge and exercised by live smoke tests.
18
+ `UNSUPPORTED_OPERATION` means the connected Foundry runtime cannot perform the requested operation.
19
+ Repeating the same request will not fix it. Choose a supported operation or use a compatible runtime.
@@ -1,113 +1,115 @@
1
1
  # Getting started
2
2
 
3
- This walkthrough covers the first run in detail: starting the daemon, pairing a Foundry GM client,
4
- and confirming the bridge, with what to expect at each step and what to do when something deviates.
3
+ ## Before you begin
5
4
 
6
- ## 1. Start the daemon
5
+ You need Node.js 20 or newer, Foundry VTT v13 or v14, and a GM account in the target world.
6
+ Install the CLI on the machine where you use your AI agent and GM browser. The Foundry server
7
+ can be hosted elsewhere; the bridge runs in your browser.
8
+
9
+ Install the CLI:
7
10
 
8
11
  ```bash
9
- fvtt-world-cli bridge serve
12
+ npm install -g fvtt-world-cli
10
13
  ```
11
14
 
12
- The daemon is the meeting point of the other two parts: the Foundry module connects to it, the CLI
13
- sends commands to it, and it routes each command into the GM session. It listens on
14
- `ws://127.0.0.1:47833` unless overridden and stays running in the foreground for as long as the
15
- tool is in use.
15
+ In Foundry's *Install Module* dialog, paste this manifest URL:
16
16
 
17
- The daemon should be running before the Foundry GM client loads the world: the module tries to
18
- connect once when the world loads, and if the daemon is down at that moment it gives up with a
19
- warning. Connecting after that is a manual retry: Connect in the scene controls, or a client
20
- reload.
17
+ ```
18
+ https://github.com/DroiD16/fvtt-world-cli/releases/latest/download/module.json
19
+ ```
21
20
 
22
- ## 2. Pair the Foundry GM client
21
+ Enable *World CLI for Foundry VTT* in the target world. The CLI and module must come from the
22
+ same release. If either was already installed, follow [Updating](#updating) to bring them into sync.
23
23
 
24
- Pairing is how a browser gets its own permission to talk to the daemon; it happens once per
25
- browser.
24
+ ## 1. Start the daemon
26
25
 
27
- It starts in the module's Authorization window. The quickest way there is the `World CLI` group at
28
- the bottom of the left scene controls; its icon doubles as a status light:
26
+ ```bash
27
+ fvtt-world-cli bridge serve
28
+ ```
29
29
 
30
- - muted grey: not paired yet
31
- - amber: connecting
32
- - green: the bridge is up
33
- - red: stopped or failed
30
+ The daemon connects the CLI to your GM browser. By default it listens on
31
+ `ws://127.0.0.1:47833` and stays running in this terminal for as long as you use the tool.
32
+ Keep the terminal open and use a second terminal for the remaining commands.
34
33
 
35
- The same windows are also reachable through Configure Settings Module Settings:
34
+ With the daemon running, open the world in your GM browser. If the world was already open when
35
+ you started the daemon, choose *Connect* in the World CLI scene controls or reload the client.
36
36
 
37
- ![The module settings](images/module-settings.png)
37
+ ## 2. Pair the Foundry GM client
38
+
39
+ Open *Authorization* from the *World CLI* group in the left scene controls. The same window is
40
+ available through Configure Settings → Module Settings → World CLI for Foundry VTT.
38
41
 
39
- The module finds the daemon through its `Daemon URL` setting. By default it already points where
40
- the daemon listens, so there is nothing to configure; the setting exists for running the daemon on
41
- a custom port or address, and then it has to match the URL that `bridge serve` prints at startup.
42
+ ![The module settings](images/module-settings.png)
42
43
 
43
- The `Browser label` field in the Authorization window is how this browser will be named in approval
44
- prompts and in `auth list`. It is editable until pairing; after pairing it is fixed, and changing
45
- it takes an Unpair followed by a new Pair. Each browser also carries its own permanent client
46
- identifier, so several browsers stay paired side by side and a re-pair replaces only that browser's
47
- record.
44
+ Enter a *Browser label* that you will recognize in the terminal, then choose *Pair*.
48
45
 
49
46
  ![The Authorization window before pairing](images/authorization-window.png)
50
47
 
51
- Choose Pair, then approve the request from a terminal on the daemon's machine. The approval is
52
- what turns the request into a stored permission:
48
+ In your second terminal, run:
53
49
 
54
50
  ```bash
55
51
  fvtt-world-cli auth
56
52
  ```
57
53
 
58
- The command waits for the pairing request; starting it before or after clicking Pair works either
59
- way. It shows who is asking, with the origin, world, GM, browser label, and client id, and asks
60
- `Approve pairing request <code>? [y/N]`. Typing `y` and pressing Enter approves it; any other
61
- answer denies it. To read a request over before deciding, or to approve from a script, the same
62
- approval exists as two steps:
54
+ The command shows the requesting origin, world, GM, browser label, and client id. Check that
55
+ these match the browser you just paired. At `Approve pairing request <code>? [y/N]`, type `y`
56
+ and press Enter to approve. Any other answer denies the request.
63
57
 
64
- ```bash
65
- fvtt-world-cli auth pending
66
- fvtt-world-cli auth approve <code> # add --yes in a script to skip the confirmation
67
- ```
58
+ Pairing is saved for this browser, world, and GM; you do not repeat it on each use.
59
+
60
+ ## 3. Check the connection
68
61
 
69
- ## 3. Confirm the bridge
62
+ After pairing approval, the *World CLI* icon in the scene controls turns green. Open *Bridge status*
63
+ from the same group to see the connection details. No reload is needed after pairing.
70
64
 
71
- On approval the browser stores its pairing credential and starts the bridge immediately. No
72
- reload is needed, and the scene-controls icon turns green. From now on the bridge connects on its
73
- own as soon as the world loads: that is the client-scoped `Connect automatically` setting, enabled
74
- by default; with it disabled the bridge stays offline until Connect is chosen.
65
+ On later runs, start the daemon before opening the world. The browser reconnects automatically
66
+ unless you disable *Connect automatically* in the module settings.
75
67
 
76
- A first command confirms the connection end to end:
68
+ ## Start working
69
+
70
+ To give your AI agent the operating instructions, install the packaged skill:
77
71
 
78
72
  ```bash
79
- fvtt-world-cli system info --json
73
+ fvtt-world-cli skill install
80
74
  ```
81
75
 
82
- It reports `bridge.status` as `connected`.
76
+ [Agent skill](skill.md) explains installation options and updates. For manual use, start with the
77
+ [common workflows](commands.md#common-workflows).
78
+
79
+ ## Updating
80
+
81
+ Update the CLI and Foundry module to the same release. Components from different releases refuse
82
+ to connect, even when their command lists look the same.
83
+
84
+ 1. Stop the daemon with Ctrl+C in its terminal.
85
+ 2. Update the CLI:
86
+
87
+ ```bash
88
+ npm install -g fvtt-world-cli@latest
89
+ ```
83
90
 
84
- Commands use the permissions stored for that browser profile. Run `fvtt-world-cli commands` after
85
- the bridge connects to see which commands the client will run. A daemon that rejects the browser
86
- credential returns an error instead of the static registry.
91
+ 3. Update *World CLI for Foundry VTT* in Foundry's module management screen.
92
+ 4. Start `fvtt-world-cli bridge serve` again, then open or reload the GM client.
93
+ 5. Check that the *World CLI* icon is green.
87
94
 
88
- Destructive commands ask the GM by default. Set each command's behavior under Configure Settings →
89
- Module Settings → World CLI → Command permissions. Set the waiting time in the `Approval timeout
90
- (minutes)` field in the main Module Settings form. [Commands](commands.md#command-permissions-and-approval)
91
- describes the behavior in full.
95
+ Existing browser pairings remain valid.
92
96
 
93
- ## When something deviates
97
+ ## Troubleshooting
94
98
 
95
- The Bridge status window (in the scene controls or the module settings) is the first place to
96
- look: it names the connection state in the same colours as the icon and shows the daemon URL, the
97
- last connection time, the reconnect attempts, and the reason behind a stop, updating itself while
98
- open.
99
+ Open *Bridge status* first. It shows the daemon URL, connection state, and the reason for a stop.
99
100
 
100
- Two buttons cover recovery. Connect builds a fresh bridge client, which is also what clears a stop
101
- such as `BRIDGE_BUSY` or `DAEMON_UNAVAILABLE`, and during a reconnect wait it retries immediately
102
- instead of waiting out the backoff delay. Disconnect abandons the connection and tells the daemon
103
- goodbye, so the daemon frees its active bridge slot right away instead of waiting out an
104
- abnormal-disconnect lease.
101
+ | What you see | What to do |
102
+ |---|---|
103
+ | The daemon was unavailable when the world loaded | Start the daemon, then choose *Connect* or reload the GM client. |
104
+ | `BRIDGE_BUSY` | Another paired browser holds the connection. Choose *Disconnect* there, then *Connect* in the browser you want to use. Keep the existing pairing. |
105
+ | A protocol-version mismatch | Follow [Updating](#updating). The status window identifies the component that needs an update when it can compare the versions. |
106
+ | The daemon URL does not match | Set the module's *Daemon URL* to the address printed by `bridge serve`. The defaults already match. |
107
+ | *Connect automatically* is disabled | Choose *Connect*, or enable that setting for future world loads. |
108
+ | A command waits for GM approval | Answer the Command Approval window in Foundry. The command continues after approval. |
109
+ | Unpair cannot reach the daemon | Restore the daemon and retry. *Forget local* removes only the browser's credential; the daemon profile remains until `auth revoke <pairingId>` succeeds. |
105
110
 
106
- One bridge is active at a time, so a second paired browser's connection attempt stops on
107
- `BRIDGE_BUSY` and stays stopped. Switching browsers is a Disconnect on the active one followed by
108
- Connect on the other; pairing plays no part in it.
111
+ If the active browser is unavailable, `fvtt-world-cli bridge release` frees its slot. The released
112
+ browser stays stopped until its operator chooses *Connect*.
109
113
 
110
- Authorization holds the two exits. Unpair revokes this browser's access and removes its credential
111
- once the daemon confirms the revocation. Forget local is the recovery for a daemon that cannot be
112
- reached: it clears only the browser's side, and the daemon's record stays active until
113
- `auth revoke <pairingId>` succeeds.
114
+ For pairing management, scripted approval, and profile removal, see
115
+ [Authorization commands](commands.md#authorization-commands).
Binary file