avrae-ls 0.5.0__tar.gz → 0.6.0__tar.gz
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.
- {avrae_ls-0.5.0 → avrae_ls-0.6.0}/PKG-INFO +34 -4
- {avrae_ls-0.5.0 → avrae_ls-0.6.0}/README.md +32 -3
- {avrae_ls-0.5.0 → avrae_ls-0.6.0}/pyproject.toml +2 -1
- {avrae_ls-0.5.0 → avrae_ls-0.6.0}/.gitignore +0 -0
- {avrae_ls-0.5.0 → avrae_ls-0.6.0}/LICENSE +0 -0
- {avrae_ls-0.5.0 → avrae_ls-0.6.0}/src/draconic/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avrae-ls
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Language server for Avrae draconic aliases
|
|
5
5
|
Author: 1drturtle
|
|
6
6
|
License: MIT License
|
|
@@ -30,6 +30,7 @@ Requires-Dist: d20>=1.1.2
|
|
|
30
30
|
Requires-Dist: httpx>=0.27
|
|
31
31
|
Requires-Dist: lsprotocol>=2023.0.1
|
|
32
32
|
Requires-Dist: pygls>=1.3.1
|
|
33
|
+
Requires-Dist: pyyaml>=6.0
|
|
33
34
|
Provides-Extra: dev
|
|
34
35
|
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
35
36
|
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
|
|
@@ -66,18 +67,47 @@ Language Server Protocol (LSP) implementation targeting Avrae-style draconic ali
|
|
|
66
67
|
- Tests only (with coverage): `make test` or `uv run pytest tests --cov=src`.
|
|
67
68
|
- CLI smoke test without installing: `uv run python -m avrae_ls --analyze path/to/alias.txt`.
|
|
68
69
|
|
|
70
|
+
## Alias tests
|
|
71
|
+
|
|
72
|
+
- Create files ending with `.alias-test` (or `.aliastest`) next to your alias file. Each test starts with an invocation, followed by `---` and the expected result; you can stack multiple tests in one file by repeating this pattern (optional metadata after a second `---` per test).
|
|
73
|
+
```
|
|
74
|
+
!my-alias -b example args
|
|
75
|
+
---
|
|
76
|
+
expected text or number
|
|
77
|
+
```
|
|
78
|
+
- For embed aliases, put a YAML/JSON dictionary after the separator to compare against the embed preview (partial dictionaries are allowed).
|
|
79
|
+
```
|
|
80
|
+
!embedtest
|
|
81
|
+
---
|
|
82
|
+
title: Hello
|
|
83
|
+
description: World
|
|
84
|
+
```
|
|
85
|
+
- Embed fields lists can be partial: only the listed fields (in order) are matched; extra fields in the alias do not fail the test.
|
|
86
|
+
- Use regex expectations by wrapping strings in `/.../` (or `re:...`). You can also mix literals with regex segments (e.g., `Hello /world.*/`) so only the delimited part is treated as regex.
|
|
87
|
+
- Optional second `---` section can carry metadata:
|
|
88
|
+
```
|
|
89
|
+
name: critical-hit
|
|
90
|
+
vars:
|
|
91
|
+
cvars:
|
|
92
|
+
hp: 12
|
|
93
|
+
character:
|
|
94
|
+
name: Tester
|
|
95
|
+
```
|
|
96
|
+
`name` is a label for reporting, `vars` are merged into cvars/uvars/svars/gvars, and `character` keys are deep-merged into the mock character.
|
|
97
|
+
- Run them with `avrae-ls --run-tests [path]` (defaults to the current directory); non-zero exit codes indicate failures.
|
|
98
|
+
|
|
69
99
|
## Runtime differences (mock vs. live Avrae)
|
|
70
100
|
|
|
71
101
|
- Mock execution never writes back to Avrae: cvar/uvar/gvar mutations only live for the current run and reset before the next.
|
|
72
102
|
- Network is limited to gvar fetches (when `enableGvarFetch` is true) and `verify_signature`; other Avrae/Discord calls are replaced with mocked context data from `.avraels.json`.
|
|
73
103
|
- `get_gvar`/`using` values are pulled from local var files first; remote fetches go to `https://api.avrae.io/customizations/gvars/<id>` (or your `avraeService.baseUrl`) using `avraeService.token` and are cached for the session.
|
|
74
|
-
- `signature()` returns a mock string (`mock-signature:<int>`). `verify_signature()` POSTs to `/bot/signature/verify`,
|
|
104
|
+
- `signature()` returns a mock string (`mock-signature:<int>`). `verify_signature()` POSTs to `/bot/signature/verify`, reuses the last successful response per signature, and includes `avraeService.token` if present.
|
|
75
105
|
|
|
76
106
|
## Troubleshooting gvar fetch / verify_signature
|
|
77
107
|
|
|
78
108
|
- `get_gvar` returns `None` or `using(...)` raises `ModuleNotFoundError`: ensure the workspace `.avraels.json` sets `enableGvarFetch: true`, includes a valid `avraeService.token`, or seed the gvar in a var file referenced by `varFiles`.
|
|
79
109
|
- HTTP 401/403/404 from fetch/verify calls: check the token (401/403) and the gvar/signature id (404). Override `avraeService.baseUrl` if you mirror the API.
|
|
80
|
-
- Slow or flaky calls:
|
|
110
|
+
- Slow or flaky calls: disable remote fetches by flipping `enableGvarFetch` off to rely purely on local vars.
|
|
81
111
|
|
|
82
112
|
## Other editors (stdio)
|
|
83
113
|
|
|
@@ -98,7 +128,7 @@ Language Server Protocol (LSP) implementation targeting Avrae-style draconic ali
|
|
|
98
128
|
:major-modes '(fundamental-mode) ;; bind to your Avrae alias mode
|
|
99
129
|
:server-id 'avrae-ls))
|
|
100
130
|
```
|
|
101
|
-
- VS Code commands to mirror: `Avrae: Run Alias (Mock)`, `Avrae: Show Alias Preview`, and `Avrae: Reload Workspace Config` run against the same server binary.
|
|
131
|
+
- VS Code commands to mirror: `Avrae: Run Alias (Mock)`, `Avrae: Show Alias Preview`, `Avrae: Refresh GVARs`, and `Avrae: Reload Workspace Config` run against the same server binary.
|
|
102
132
|
|
|
103
133
|
## Releasing (maintainers)
|
|
104
134
|
|
|
@@ -27,18 +27,47 @@ Language Server Protocol (LSP) implementation targeting Avrae-style draconic ali
|
|
|
27
27
|
- Tests only (with coverage): `make test` or `uv run pytest tests --cov=src`.
|
|
28
28
|
- CLI smoke test without installing: `uv run python -m avrae_ls --analyze path/to/alias.txt`.
|
|
29
29
|
|
|
30
|
+
## Alias tests
|
|
31
|
+
|
|
32
|
+
- Create files ending with `.alias-test` (or `.aliastest`) next to your alias file. Each test starts with an invocation, followed by `---` and the expected result; you can stack multiple tests in one file by repeating this pattern (optional metadata after a second `---` per test).
|
|
33
|
+
```
|
|
34
|
+
!my-alias -b example args
|
|
35
|
+
---
|
|
36
|
+
expected text or number
|
|
37
|
+
```
|
|
38
|
+
- For embed aliases, put a YAML/JSON dictionary after the separator to compare against the embed preview (partial dictionaries are allowed).
|
|
39
|
+
```
|
|
40
|
+
!embedtest
|
|
41
|
+
---
|
|
42
|
+
title: Hello
|
|
43
|
+
description: World
|
|
44
|
+
```
|
|
45
|
+
- Embed fields lists can be partial: only the listed fields (in order) are matched; extra fields in the alias do not fail the test.
|
|
46
|
+
- Use regex expectations by wrapping strings in `/.../` (or `re:...`). You can also mix literals with regex segments (e.g., `Hello /world.*/`) so only the delimited part is treated as regex.
|
|
47
|
+
- Optional second `---` section can carry metadata:
|
|
48
|
+
```
|
|
49
|
+
name: critical-hit
|
|
50
|
+
vars:
|
|
51
|
+
cvars:
|
|
52
|
+
hp: 12
|
|
53
|
+
character:
|
|
54
|
+
name: Tester
|
|
55
|
+
```
|
|
56
|
+
`name` is a label for reporting, `vars` are merged into cvars/uvars/svars/gvars, and `character` keys are deep-merged into the mock character.
|
|
57
|
+
- Run them with `avrae-ls --run-tests [path]` (defaults to the current directory); non-zero exit codes indicate failures.
|
|
58
|
+
|
|
30
59
|
## Runtime differences (mock vs. live Avrae)
|
|
31
60
|
|
|
32
61
|
- Mock execution never writes back to Avrae: cvar/uvar/gvar mutations only live for the current run and reset before the next.
|
|
33
62
|
- Network is limited to gvar fetches (when `enableGvarFetch` is true) and `verify_signature`; other Avrae/Discord calls are replaced with mocked context data from `.avraels.json`.
|
|
34
63
|
- `get_gvar`/`using` values are pulled from local var files first; remote fetches go to `https://api.avrae.io/customizations/gvars/<id>` (or your `avraeService.baseUrl`) using `avraeService.token` and are cached for the session.
|
|
35
|
-
- `signature()` returns a mock string (`mock-signature:<int>`). `verify_signature()` POSTs to `/bot/signature/verify`,
|
|
64
|
+
- `signature()` returns a mock string (`mock-signature:<int>`). `verify_signature()` POSTs to `/bot/signature/verify`, reuses the last successful response per signature, and includes `avraeService.token` if present.
|
|
36
65
|
|
|
37
66
|
## Troubleshooting gvar fetch / verify_signature
|
|
38
67
|
|
|
39
68
|
- `get_gvar` returns `None` or `using(...)` raises `ModuleNotFoundError`: ensure the workspace `.avraels.json` sets `enableGvarFetch: true`, includes a valid `avraeService.token`, or seed the gvar in a var file referenced by `varFiles`.
|
|
40
69
|
- HTTP 401/403/404 from fetch/verify calls: check the token (401/403) and the gvar/signature id (404). Override `avraeService.baseUrl` if you mirror the API.
|
|
41
|
-
- Slow or flaky calls:
|
|
70
|
+
- Slow or flaky calls: disable remote fetches by flipping `enableGvarFetch` off to rely purely on local vars.
|
|
42
71
|
|
|
43
72
|
## Other editors (stdio)
|
|
44
73
|
|
|
@@ -59,7 +88,7 @@ Language Server Protocol (LSP) implementation targeting Avrae-style draconic ali
|
|
|
59
88
|
:major-modes '(fundamental-mode) ;; bind to your Avrae alias mode
|
|
60
89
|
:server-id 'avrae-ls))
|
|
61
90
|
```
|
|
62
|
-
- VS Code commands to mirror: `Avrae: Run Alias (Mock)`, `Avrae: Show Alias Preview`, and `Avrae: Reload Workspace Config` run against the same server binary.
|
|
91
|
+
- VS Code commands to mirror: `Avrae: Run Alias (Mock)`, `Avrae: Show Alias Preview`, `Avrae: Refresh GVARs`, and `Avrae: Reload Workspace Config` run against the same server binary.
|
|
63
92
|
|
|
64
93
|
## Releasing (maintainers)
|
|
65
94
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "avrae-ls"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.6.0"
|
|
8
8
|
description = "Language server for Avrae draconic aliases"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "1drturtle" }
|
|
@@ -17,6 +17,7 @@ dependencies = [
|
|
|
17
17
|
"lsprotocol>=2023.0.1",
|
|
18
18
|
"httpx>=0.27",
|
|
19
19
|
"d20>=1.1.2",
|
|
20
|
+
"pyyaml>=6.0",
|
|
20
21
|
]
|
|
21
22
|
|
|
22
23
|
[project.optional-dependencies]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|