dsh-unreal-python-api 0.0.0-stage → 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 — 2026-11-30
4
+
5
+ First release.
6
+
7
+ - `unreal_python_tools_list` — enumerate the published Unreal Python 5.8 surface,
8
+ a namespace's direct members, or one kind of symbol, with documentation links.
9
+ - `unreal_python_search` — rank 66,849 inventory symbols (exact, member-name
10
+ prefix, substring) and filter by kind or parent.
11
+ - `unreal_python_syntax` — read the exact signature, description, parameter table
12
+ and return type from Epic's published documentation page for a symbol.
13
+ - `unreal_python_tool_builder` — scaffold a tool from an intent plus verified API
14
+ symbols in four styles: `toolset` (ToolsetRegistry toolset class with its test
15
+ module), `editor_script`, `mcp_tool` (MCP tool descriptors in JSON plus the
16
+ Python handler module that serves them), and `dsh_tool` (a DSH plugin tool
17
+ module built on `defineTool`, with a Node test module). Unverified symbols are
18
+ reported instead of being written into the code.
19
+ - Inventory downloaded from Epic's `objects.inv`, cached locally, refreshed every
20
+ 24 hours by default.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Taimoor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,142 @@
1
- # Temporary Holding Version
1
+ # dsh-unreal-python-api
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An Unreal Engine Python API context plugin for DeepSeek Harness. It gives agents
4
+ the documented Unreal Python surface — listing, search, exact syntax, and tool
5
+ scaffolding in four flavours — from the symbol inventory Epic publishes beside the
6
+ Python API documentation. See [docs/DETAIL.md](docs/DETAIL.md) for what each tool
7
+ returns and how the data is kept.
8
+
9
+ ## What the agent gets
10
+
11
+ | Tool | What it does |
12
+ |---|---|
13
+ | `unreal_python_tools_list` | The published symbol surface: totals by kind, one namespace's direct members, or one kind of symbol, each with a documentation link. |
14
+ | `unreal_python_search` | 66,849 inventory symbols ranked exact → member-name prefix → substring, filterable by kind or parent. |
15
+ | `unreal_python_syntax` | The exact signature, description, parameter table and return type, read from Epic's published page for that symbol. |
16
+ | `unreal_python_tool_builder` | Scaffolds a tool from an intent plus verified symbols in four styles: `toolset`, `editor_script`, `mcp_tool`, `dsh_tool`. |
17
+
18
+ A short system-prompt section tells the agent the tools exist, so it reaches for
19
+ the published API instead of guessing names. Symbols that are not in the inventory
20
+ are reported as `unresolved` and never written into generated code.
21
+
22
+ ## What to expect — and what not to
23
+
24
+ Expect:
25
+
26
+ - **Correct names and signatures, with a source link.** Every symbol the tools
27
+ return comes from Epic's own inventory for the installed documentation version
28
+ (5.8 at the time of writing), and `unreal_python_syntax` reads the published
29
+ page, so parameter names and defaults match the documentation rather than a
30
+ model's memory.
31
+ - **Scaffolds that compile as far as the API surface goes.** Generated artifacts
32
+ are parse-checked in their own language by `test/smoke.mjs`; Unreal API calls in
33
+ the comment block are verified against the inventory.
34
+ - **Four output styles for one intent**, so the same description can become a
35
+ ToolsetRegistry toolset for the editor, an MCP tool descriptor set, or a DSH
36
+ plugin tool module.
37
+
38
+ Do not expect:
39
+
40
+ - **A live editor connection.** This plugin reads documentation only. It never
41
+ talks to a running Unreal Editor, so it cannot report your project's actual
42
+ assets, and a generated tool body is a skeleton that raises until you implement
43
+ it.
44
+ - **Behaviour for free.** The builder emits structure, verified imports and
45
+ signatures; the logic inside each tool body is yours to write and test.
46
+ - **Version independence.** The inventory version follows Epic's published
47
+ documentation for the URL in `docBaseUrl`; check it matches your engine when
48
+ that matters.
49
+
50
+ ## Install
51
+
52
+ From the plugin market or an index source: install `dsh-unreal-python-api`.
53
+
54
+ From npm after publishing:
55
+
56
+ ```powershell
57
+ dsh plugin --profile web add dsh-unreal-python-api
58
+ ```
59
+
60
+ From a local checkout (no publish needed):
61
+
62
+ ```powershell
63
+ dsh plugin --profile web add "<this directory>"
64
+ ```
65
+
66
+ A local install links this directory. Because the link is resolved through its
67
+ real path, the host-provided packages `@deepseek-ai/dsh-tools` and
68
+ `@deepseek-ai/schemastery` must be reachable from here — run `link-deps.ps1`
69
+ once after cloning, and again after a DSH upgrade moves the install root:
70
+
71
+ ```powershell
72
+ .\link-deps.ps1 # uses $env:DSH_INSTALL_DIR
73
+ .\link-deps.ps1 -InstallRoot "C:\path\to\@deepseek-ai\dsh"
74
+ ```
75
+
76
+ Removing it: `dsh plugin --profile web remove dsh-unreal-python-api`.
77
+
78
+ ## Requirements
79
+
80
+ - DeepSeek Harness with the `tools` and `systemPrompt` services (0.2.2-rc.5 or
81
+ newer). `@deepseek-ai/dsh-tools` is host-provided: the version on npm
82
+ (`0.0.1-rc.1`) is older than the one the harness ships, so it is deliberately
83
+ not declared as a dependency.
84
+ - Node 20+ (global `fetch`, `node:zlib`) — no third-party dependencies.
85
+ - Network access on the first run (the inventory is 612 KB, then cached).
86
+ - Optional: Python on PATH, so the smoke test can parse-check the Python
87
+ artifacts it generates.
88
+
89
+ ## Test
90
+
91
+ ```bash
92
+ node test/smoke.mjs
93
+ ```
94
+
95
+ It downloads (or reuses) the inventory, then asserts the published version and
96
+ symbol total, exact-match ranking and kind filtering in search, direct-member
97
+ listing, a real signature read from a documentation page, an absent symbol being
98
+ reported unresolved, scaffolds for all four styles that keep unverified symbols
99
+ out of the generated code, and that every generated artifact parses with its own
100
+ compiler (`python -c "ast.parse"`, `node --check`).
101
+
102
+ ## Layout
103
+
104
+ ```
105
+ index.js plugin entry: Config, the four tools, the prompt section
106
+ lib/inventory.js inventory download, cache, parse, search, member listing
107
+ lib/docs.js documentation page reader: signature, description, parameters
108
+ lib/builder.js the four scaffold styles
109
+ test/smoke.mjs live data-path test (network + cache + every capability)
110
+ cordis.patch.yml bundle patch row
111
+ locale/, icon.svg Host display metadata
112
+ ```
113
+
114
+ ## Configuration
115
+
116
+ | Key | Default | Meaning |
117
+ |---|---|---|
118
+ | `docBaseUrl` | Epic's published Python API docs | Inventory and page root. |
119
+ | `cacheDir` | `%LOCALAPPDATA%\dsh-unreal-python-api` | Where the inventory is cached. |
120
+ | `refreshHours` | `24` | Cache freshness window; `0` forces a refetch. |
121
+ | `maxResults` | `30` | Upper bound on rows a tool returns. |
122
+ | `fetchTimeoutMs` | `30000` | Page and inventory timeout. |
123
+ | `promptSection` | `true` | Register the system-prompt section. |
124
+
125
+ ## Publishing to the market
126
+
127
+ The market catalog is curated through
128
+ `github.com/awesome-dsh-plugin/awesome-dsh-plugin`: add one entry there and the
129
+ site and in-app market pick it up. Installs prefer an npm package, then a GitHub
130
+ Release tarball, then the repository itself, all through `dsh plugin add`.
131
+ Keep `private` out of `package.json` before publishing to npm.
132
+
133
+ ## Adding a capability
134
+
135
+ Tool registration lives in `apply()` in `index.js`; each tool is one
136
+ `ctx.tools.register(defineTool({...}))` call. Data-layer helpers belong in `lib/`
137
+ and must stay runnable under plain Node so `test/smoke.mjs` can exercise them
138
+ without the DSH runtime.
139
+
140
+ ## License
141
+
142
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,4 @@
1
+ - insert:
2
+ - id: unreal-python-api
3
+ name: 'dsh-unreal-python-api'
4
+ config: {}
package/docs/DETAIL.md ADDED
@@ -0,0 +1,78 @@
1
+ # Unreal Python API context — detail
2
+
3
+ This plugin gives an agent the documented Unreal Engine Python API while it works,
4
+ without the agent guessing at Unreal symbols or fetching whole documentation pages.
5
+
6
+ ## Where the data comes from
7
+
8
+ Epic publishes the Unreal Python API as Sphinx documentation at
9
+ <https://dev.epicgames.com/documentation/en-us/unreal-engine/python-api/>.
10
+ Next to those pages Sphinx publishes `objects.inv`, an inventory of every
11
+ documented symbol:
12
+
13
+ | Fact | Value at the time of writing |
14
+ | --- | --- |
15
+ | Inventory URL | `<docBaseUrl>/objects.inv` |
16
+ | Size | ~612 KB, zlib-compressed |
17
+ | Documented version | Unreal Python 5.8 |
18
+ | Symbols | 66,849 |
19
+ | Kinds | 17,896 methods, 17,099 properties, 11,678 doc pages, 11,675 classes, 8,441 attributes, 50 functions, 10 labels |
20
+
21
+ The inventory is downloaded once, cached on disk, and parsed in memory. Every
22
+ row the tools return comes from that file, and a symbol that is not in it is
23
+ reported as unresolved rather than being invented. Signature, description,
24
+ parameters, and return value come from the documentation page that carries the
25
+ symbol.
26
+
27
+ ## Tools
28
+
29
+ **`unreal_python_tools_list`** — lists the API surface. Without `parent` it
30
+ reports the symbol total and the per-kind counts. With `parent` such as
31
+ `unreal.EditorAssetLibrary` or `unreal.Actor` it lists that namespace's or
32
+ class's direct members, with per-kind counts and the documentation URL of each.
33
+ `refresh: true` downloads the inventory again.
34
+
35
+ **`unreal_python_search`** — finds symbols by name. Ranking is exact name, then
36
+ case-insensitive exact, then member name (the text after the last dot) starting
37
+ with the query, then any containing name. So `save_asset` reaches
38
+ `unreal.EditorAssetLibrary.save_asset` first, and `set_actor` reaches
39
+ `unreal.Actor.set_actor_scale3d`. `kind` and `parent` narrow the search.
40
+
41
+ **`unreal_python_syntax`** — returns the exact syntax of one or more symbols:
42
+ signature, summary, parameter rows, return value, and the documentation URL,
43
+ deep-linked to the symbol's anchor. A symbol whose page has no anchor for it is
44
+ returned with `resolved: false` and a note instead of a guess.
45
+
46
+ **`unreal_python_tool_builder`** — scaffolds an Unreal Python tool from a
47
+ description and a list of API symbols per tool. It emits either a ToolsetRegistry
48
+ toolset class (`@unreal.uclass()` on `unreal.ToolsetDefinition`,
49
+ `@toolset_registry.tool_call` static methods with annotated parameters,
50
+ docstring, registration and unregistration functions) or a plain editor script,
51
+ plus a test module skeleton. Each requested symbol is verified against the
52
+ inventory: verified ones are recorded beside the tool body with their
53
+ documentation URL, and unverified ones are reported in `unresolved` and kept out
54
+ of the code.
55
+
56
+ Tool bodies deliberately raise `NotImplementedError`. The builder produces a
57
+ grounded starting point, not finished code.
58
+
59
+ ## Configuration
60
+
61
+ | Key | Default | Meaning |
62
+ | --- | --- | --- |
63
+ | `docBaseUrl` | Epic's Python API root | Documentation root; `objects.inv` is read relative to it. |
64
+ | `cacheDir` | `%LOCALAPPDATA%\dsh-unreal-python-api` | Where the inventory is cached. `$DSH_UNREAL_PYTHON_API_CACHE` overrides it. |
65
+ | `refreshHours` | `24` | Re-download the inventory when the cache is older than this. `0` re-downloads every load. |
66
+ | `maxResults` | `30` | Default row cap per call; a caller may ask for fewer or more, up to 200. |
67
+ | `fetchTimeoutMs` | `30000` | Per-request timeout for the inventory and documentation pages. |
68
+ | `promptSection` | `true` | Adds one line to the system prompt naming the tools and the documentation root. |
69
+
70
+ ## Failure behaviour
71
+
72
+ - Inventory: a failed download falls back to the cached copy and labels the
73
+ source `stale-cache`; with neither network nor cache the tool fails with the
74
+ URL it tried.
75
+ - Documentation pages: a fetch failure fails that symbol's syntax lookup. Pages
76
+ are cached in memory (24 most recent) so several symbols from one class page
77
+ cost one request.
78
+ - Prose on a page is treated as documentation text only.
package/icon.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128" role="img" aria-label="Unreal Python API context">
2
+ <rect x="4" y="4" width="120" height="120" rx="26" fill="#10151f"/>
3
+ <rect x="22" y="34" width="62" height="9" rx="4.5" fill="#4fb3ff"/>
4
+ <rect x="22" y="52" width="46" height="9" rx="4.5" fill="#4fb3ff" opacity="0.75"/>
5
+ <rect x="22" y="70" width="54" height="9" rx="4.5" fill="#4fb3ff" opacity="0.55"/>
6
+ <rect x="22" y="88" width="34" height="9" rx="4.5" fill="#4fb3ff" opacity="0.35"/>
7
+ <circle cx="88" cy="82" r="17" fill="#10151f" stroke="#22d3a6" stroke-width="7"/>
8
+ <path d="M100 94 L112 106" stroke="#22d3a6" stroke-width="9" stroke-linecap="round"/>
9
+ </svg>