avrae-ls 0.3.0__tar.gz → 0.4.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.
Files changed (56) hide show
  1. avrae_ls-0.4.0/PKG-INFO +86 -0
  2. avrae_ls-0.4.0/README.md +67 -0
  3. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/pyproject.toml +1 -1
  4. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/api.py +229 -229
  5. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/argparser.py +16 -3
  6. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/completions.py +177 -27
  7. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/config.py +61 -2
  8. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/context.py +62 -1
  9. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/diagnostics.py +207 -2
  10. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/parser.py +7 -2
  11. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/runtime.py +94 -18
  12. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/server.py +38 -1
  13. avrae_ls-0.4.0/src/avrae_ls/symbols.py +266 -0
  14. avrae_ls-0.4.0/src/avrae_ls.egg-info/PKG-INFO +86 -0
  15. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls.egg-info/SOURCES.txt +2 -0
  16. avrae_ls-0.4.0/tests/test_api.py +105 -0
  17. avrae_ls-0.4.0/tests/test_argparser_unit.py +42 -0
  18. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_completions.py +112 -0
  19. avrae_ls-0.4.0/tests/test_config_env.py +65 -0
  20. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_diagnostics.py +79 -0
  21. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_runtime.py +125 -2
  22. avrae_ls-0.4.0/tests/test_symbols.py +112 -0
  23. avrae_ls-0.3.0/PKG-INFO +0 -47
  24. avrae_ls-0.3.0/README.md +0 -28
  25. avrae_ls-0.3.0/src/avrae_ls/symbols.py +0 -150
  26. avrae_ls-0.3.0/src/avrae_ls.egg-info/PKG-INFO +0 -47
  27. avrae_ls-0.3.0/tests/test_api.py +0 -50
  28. avrae_ls-0.3.0/tests/test_symbols.py +0 -21
  29. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/LICENSE +0 -0
  30. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/setup.cfg +0 -0
  31. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/__init__.py +0 -0
  32. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/__main__.py +0 -0
  33. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/alias_preview.py +0 -0
  34. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/argument_parsing.py +0 -0
  35. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/cvars.py +0 -0
  36. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/dice.py +0 -0
  37. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls/signature_help.py +0 -0
  38. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls.egg-info/dependency_links.txt +0 -0
  39. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls.egg-info/entry_points.txt +0 -0
  40. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls.egg-info/requires.txt +0 -0
  41. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/avrae_ls.egg-info/top_level.txt +0 -0
  42. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/LICENSE +0 -0
  43. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/__init__.py +0 -0
  44. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/exceptions.py +0 -0
  45. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/helpers.py +0 -0
  46. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/interpreter.py +0 -0
  47. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/string.py +0 -0
  48. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/types.py +0 -0
  49. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/utils.py +0 -0
  50. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/src/draconic/versions.py +0 -0
  51. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_alias_preview.py +0 -0
  52. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_argument_parsing.py +0 -0
  53. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_cvars.py +0 -0
  54. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_gvars.py +0 -0
  55. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_hover.py +0 -0
  56. {avrae_ls-0.3.0 → avrae_ls-0.4.0}/tests/test_runtime_dice.py +0 -0
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: avrae-ls
3
+ Version: 0.4.0
4
+ Summary: Language server for Avrae draconic aliases
5
+ Author: 1drturtle
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: pygls>=1.3.1
10
+ Requires-Dist: lsprotocol>=2023.0.1
11
+ Requires-Dist: httpx>=0.27
12
+ Requires-Dist: d20>=1.1.2
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest>=8.3; extra == "dev"
15
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
16
+ Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
17
+ Requires-Dist: ruff>=0.6; extra == "dev"
18
+ Dynamic: license-file
19
+
20
+ # Avrae Draconic Alias Language Server
21
+
22
+ Language Server Protocol (LSP) implementation targeting Avrae-style draconic aliases. It provides syntax/semantic diagnostics, a mocked execution command, and a thin configuration layer driven by a workspace `.avraels.json` file. Credit to Avrae team for all code yoinked!
23
+
24
+ ## Install (released package)
25
+
26
+ - CLI/server via `uv tool` (preferred): `uv tool install avrae-ls` then `avrae-ls --help` to see stdio/TCP options (same as `python -m avrae_ls`). The VS Code extension uses this invocation by default. The draconic interpreter is vendored, so no Git deps are needed.
27
+
28
+ ## VS Code extension (released)
29
+
30
+ - Install from VSIX: download `avrae-ls-client.vsix` from the GitHub releases page, then in VS Code run “Extensions: Install from VSIX” and select the file.
31
+ - Open your alias workspace; commands like `Avrae: Show Alias Preview` and `Avrae: Run Alias` will be available.
32
+
33
+ ## Developing locally
34
+
35
+ - Prereqs: [uv](https://github.com/astral-sh/uv) and Node.js.
36
+ - Install deps: `uv sync --all-extras` then `make vscode-deps`.
37
+ - Build everything locally: `make package` (wheel + VSIX in `dist/`).
38
+ - Run tests/lint: `make check`.
39
+ - Run via uv tool from source: `uv tool install --from . avrae-ls`.
40
+ - Run diagnostics for a single file (stdout + stderr logs): `avrae-ls --analyze path/to/alias.txt --log-level DEBUG`.
41
+
42
+ ## How to test
43
+
44
+ - Quick check (ruff + pytest): `make check` (uses `uv run ruff` and `uv run pytest` under the hood).
45
+ - Lint only: `make lint` or `uv run ruff check src tests`.
46
+ - Tests only (with coverage): `make test` or `uv run pytest tests --cov=src`.
47
+ - CLI smoke test without installing: `uv run python -m avrae_ls --analyze path/to/alias.txt`.
48
+
49
+ ## Runtime differences (mock vs. live Avrae)
50
+
51
+ - Mock execution never writes back to Avrae: cvar/uvar/gvar mutations only live for the current run and reset before the next.
52
+ - 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`.
53
+ - `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.
54
+ - `signature()` returns a mock string (`mock-signature:<int>`). `verify_signature()` POSTs to `/bot/signature/verify`, respects `verifySignatureTimeout`/`verifySignatureRetries`, reuses the last successful response per signature, and includes `avraeService.token` if present.
55
+
56
+ ## Troubleshooting gvar fetch / verify_signature
57
+
58
+ - `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`.
59
+ - 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.
60
+ - Slow or flaky calls: tune `verifySignatureTimeout` / `verifySignatureRetries`, or disable remote fetches by flipping `enableGvarFetch` off to rely purely on local vars.
61
+
62
+ ## Other editors (stdio)
63
+
64
+ - Any client can launch the server with stdio: `avrae-ls --stdio` (flag accepted for client compatibility) or `python -m avrae_ls`. The server will also auto-discover `.avraels.json` in parent folders.
65
+ - Neovim (nvim-lspconfig example):
66
+ ```lua
67
+ require("lspconfig").avraels.setup({
68
+ cmd = { "avrae-ls", "--stdio" },
69
+ filetypes = { "avrae" },
70
+ root_dir = require("lspconfig.util").root_pattern(".avraels.json", ".git"),
71
+ })
72
+ ```
73
+ - Emacs (lsp-mode snippet):
74
+ ```elisp
75
+ (lsp-register-client
76
+ (make-lsp-client
77
+ :new-connection (lsp-stdio-connection '("avrae-ls" "--stdio"))
78
+ :major-modes '(fundamental-mode) ;; bind to your Avrae alias mode
79
+ :server-id 'avrae-ls))
80
+ ```
81
+ - VS Code commands to mirror: `Avrae: Run Alias (Mock)`, `Avrae: Show Alias Preview`, and `Avrae: Reload Workspace Config` run against the same server binary.
82
+
83
+ ## Releasing (maintainers)
84
+
85
+ 1. Bump `pyproject.toml` / `package.json`
86
+ 2. Create Github release
@@ -0,0 +1,67 @@
1
+ # Avrae Draconic Alias Language Server
2
+
3
+ Language Server Protocol (LSP) implementation targeting Avrae-style draconic aliases. It provides syntax/semantic diagnostics, a mocked execution command, and a thin configuration layer driven by a workspace `.avraels.json` file. Credit to Avrae team for all code yoinked!
4
+
5
+ ## Install (released package)
6
+
7
+ - CLI/server via `uv tool` (preferred): `uv tool install avrae-ls` then `avrae-ls --help` to see stdio/TCP options (same as `python -m avrae_ls`). The VS Code extension uses this invocation by default. The draconic interpreter is vendored, so no Git deps are needed.
8
+
9
+ ## VS Code extension (released)
10
+
11
+ - Install from VSIX: download `avrae-ls-client.vsix` from the GitHub releases page, then in VS Code run “Extensions: Install from VSIX” and select the file.
12
+ - Open your alias workspace; commands like `Avrae: Show Alias Preview` and `Avrae: Run Alias` will be available.
13
+
14
+ ## Developing locally
15
+
16
+ - Prereqs: [uv](https://github.com/astral-sh/uv) and Node.js.
17
+ - Install deps: `uv sync --all-extras` then `make vscode-deps`.
18
+ - Build everything locally: `make package` (wheel + VSIX in `dist/`).
19
+ - Run tests/lint: `make check`.
20
+ - Run via uv tool from source: `uv tool install --from . avrae-ls`.
21
+ - Run diagnostics for a single file (stdout + stderr logs): `avrae-ls --analyze path/to/alias.txt --log-level DEBUG`.
22
+
23
+ ## How to test
24
+
25
+ - Quick check (ruff + pytest): `make check` (uses `uv run ruff` and `uv run pytest` under the hood).
26
+ - Lint only: `make lint` or `uv run ruff check src tests`.
27
+ - Tests only (with coverage): `make test` or `uv run pytest tests --cov=src`.
28
+ - CLI smoke test without installing: `uv run python -m avrae_ls --analyze path/to/alias.txt`.
29
+
30
+ ## Runtime differences (mock vs. live Avrae)
31
+
32
+ - Mock execution never writes back to Avrae: cvar/uvar/gvar mutations only live for the current run and reset before the next.
33
+ - 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
+ - `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`, respects `verifySignatureTimeout`/`verifySignatureRetries`, reuses the last successful response per signature, and includes `avraeService.token` if present.
36
+
37
+ ## Troubleshooting gvar fetch / verify_signature
38
+
39
+ - `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
+ - 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: tune `verifySignatureTimeout` / `verifySignatureRetries`, or disable remote fetches by flipping `enableGvarFetch` off to rely purely on local vars.
42
+
43
+ ## Other editors (stdio)
44
+
45
+ - Any client can launch the server with stdio: `avrae-ls --stdio` (flag accepted for client compatibility) or `python -m avrae_ls`. The server will also auto-discover `.avraels.json` in parent folders.
46
+ - Neovim (nvim-lspconfig example):
47
+ ```lua
48
+ require("lspconfig").avraels.setup({
49
+ cmd = { "avrae-ls", "--stdio" },
50
+ filetypes = { "avrae" },
51
+ root_dir = require("lspconfig.util").root_pattern(".avraels.json", ".git"),
52
+ })
53
+ ```
54
+ - Emacs (lsp-mode snippet):
55
+ ```elisp
56
+ (lsp-register-client
57
+ (make-lsp-client
58
+ :new-connection (lsp-stdio-connection '("avrae-ls" "--stdio"))
59
+ :major-modes '(fundamental-mode) ;; bind to your Avrae alias mode
60
+ :server-id 'avrae-ls))
61
+ ```
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.
63
+
64
+ ## Releasing (maintainers)
65
+
66
+ 1. Bump `pyproject.toml` / `package.json`
67
+ 2. Create Github release
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "avrae-ls"
7
- version = "0.3.0"
7
+ version = "0.4.0"
8
8
  description = "Language server for Avrae draconic aliases"
9
9
  authors = [
10
10
  { name = "1drturtle" }