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/lib/docs.js ADDED
@@ -0,0 +1,196 @@
1
+ /**
2
+ * Reads one documented symbol out of the published Unreal Python API pages.
3
+ *
4
+ * The pages are Sphinx output, so a symbol is an element with
5
+ * `id="<dotted name>"` whose signature is the enclosing definition term and
6
+ * whose description, parameters, and return value follow in the definition
7
+ * body. Only the requested slice is returned; the page itself never is.
8
+ *
9
+ * @module dsh-unreal-python-api/docs
10
+ */
11
+
12
+ import { pageUrl } from './inventory.js'
13
+
14
+ /** Largest page accepted, guarding against an unexpected response body. */
15
+ const MAX_PAGE_BYTES = 12 * 1024 * 1024
16
+
17
+ /** Pages kept in memory for the process lifetime. */
18
+ const PAGE_CACHE_LIMIT = 24
19
+
20
+ /** Description characters returned per symbol. */
21
+ const DESCRIPTION_LIMIT = 400
22
+
23
+ /** Parameter rows returned per symbol. */
24
+ const PARAMETER_LIMIT = 24
25
+
26
+ const pageCache = new Map()
27
+
28
+ /**
29
+ * Escape a literal for use inside a regular expression.
30
+ * @param {string} value Literal text.
31
+ * @returns {string} Escaped text.
32
+ */
33
+ function escapeRegExp(value) {
34
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
35
+ }
36
+
37
+ /**
38
+ * Convert one HTML numeric entity to text.
39
+ * @param {number} code Unicode code point.
40
+ * @returns {string} The character, or an empty string when out of range.
41
+ */
42
+ function fromCodePoint(code) {
43
+ try {
44
+ return String.fromCodePoint(code)
45
+ } catch {
46
+ return ''
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Decode the HTML entities Sphinx emits in signatures and prose.
52
+ * @param {string} text Text containing entities.
53
+ * @returns {string} Decoded text.
54
+ */
55
+ function decodeEntities(text) {
56
+ return text
57
+ .replace(/&#x([0-9a-f]+);/gi, (_match, hex) => fromCodePoint(Number.parseInt(hex, 16)))
58
+ .replace(/&#(\d+);/g, (_match, decimal) => fromCodePoint(Number(decimal)))
59
+ .replace(/&nbsp;/g, ' ')
60
+ .replace(/&lt;/g, '<')
61
+ .replace(/&gt;/g, '>')
62
+ .replace(/&quot;/g, '"')
63
+ .replace(/&#39;/g, "'")
64
+ .replace(/&amp;/g, '&')
65
+ }
66
+
67
+ /**
68
+ * Reduce an HTML fragment to single-spaced plain text.
69
+ * @param {string} html HTML fragment.
70
+ * @returns {string} Plain text.
71
+ */
72
+ function stripTags(html) {
73
+ return decodeEntities(html.replace(/<[^>]+>/g, ' ')).replace(/\s+/g, ' ').trim()
74
+ }
75
+
76
+ /**
77
+ * Read the definition body that follows a symbol's signature.
78
+ * @param {string} html Full page HTML.
79
+ * @param {number} termEnd Index just past the closing signature tag.
80
+ * @returns {string} Body HTML, or an empty string when there is none.
81
+ */
82
+ function bodyAfter(html, termEnd) {
83
+ const start = html.indexOf('<dd', termEnd)
84
+ if (start < 0 || start - termEnd > 600) return ''
85
+ const candidates = [html.indexOf('<dt class="sig', start), html.indexOf('</dl>', start)]
86
+ .filter((index) => index >= 0)
87
+ const end = candidates.length > 0 ? Math.min(...candidates) : html.length
88
+ return html.slice(start, end)
89
+ }
90
+
91
+ /**
92
+ * Extract parameter rows from a definition body.
93
+ * @param {string} body Body HTML.
94
+ * @returns {Array<{name: string, text: string}>} Parameter rows.
95
+ */
96
+ function readParameters(body) {
97
+ const field = body.match(/<dt class="field-(?:odd|even)">Parameters<\/dt><dd class="field-(?:odd|even)">([\s\S]*?)<\/dd>/)
98
+ if (!field) return []
99
+ const rows = []
100
+ const item = /<li><p><strong>([^<]+)<\/strong>([\s\S]*?)<\/p><\/li>/g
101
+ let match = item.exec(field[1])
102
+ while (match && rows.length < PARAMETER_LIMIT) {
103
+ const text = stripTags(match[2]).replace(/^[\s\u2013\u2014-]+/, '')
104
+ rows.push({ name: stripTags(match[1]), text: text.slice(0, 200) })
105
+ match = item.exec(field[1])
106
+ }
107
+ if (rows.length > 0) return rows
108
+ const fallback = stripTags(field[1])
109
+ return fallback === '' ? [] : [{ name: '', text: fallback.slice(0, 400) }]
110
+ }
111
+
112
+ /**
113
+ * Extract one field value such as Returns from a definition body.
114
+ * @param {string} body Body HTML.
115
+ * @param {string} label Field label.
116
+ * @returns {string} Field text, or an empty string.
117
+ */
118
+ function readField(body, label) {
119
+ const field = body.match(new RegExp(`<dt class="field-(?:odd|even)">${label}</dt><dd class="field-(?:odd|even)">([\\s\\S]*?)</dd>`))
120
+ return field ? stripTags(field[1]).slice(0, 300) : ''
121
+ }
122
+
123
+ /**
124
+ * Read a symbol's signature and documentation from one page.
125
+ * @param {string} html Page HTML.
126
+ * @param {string} symbol Dotted symbol name.
127
+ * @returns {{signature: string, description: string, parameters: Array<{name: string, text: string}>, returns: string} | null} Extracted entry, or null when the page has no such anchor.
128
+ */
129
+ export function extractSymbol(html, symbol) {
130
+ const anchor = html.search(new RegExp(`id="${escapeRegExp(symbol)}"`))
131
+ if (anchor < 0) return null
132
+ const termStart = html.lastIndexOf('<dt', anchor)
133
+ const termEnd = html.indexOf('</dt>', anchor)
134
+ if (termStart < 0 || termEnd < 0) return null
135
+ const signature = stripTags(html.slice(termStart, termEnd))
136
+ .replace(/\u00b6/g, '')
137
+ .replace(/\s*\[source\]\s*$/i, '')
138
+ .trim()
139
+ const body = bodyAfter(html, termEnd)
140
+ const paragraph = body.match(/<p>([\s\S]*?)<\/p>/)
141
+ return {
142
+ signature,
143
+ description: paragraph ? stripTags(paragraph[1]).slice(0, DESCRIPTION_LIMIT) : '',
144
+ parameters: readParameters(body),
145
+ returns: readField(body, 'Returns') || readField(body, 'Return type'),
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Fetch a documentation page, reusing recent pages.
151
+ * @param {string} url Page URL.
152
+ * @param {number} timeoutMs Fetch timeout budget.
153
+ * @returns {Promise<string>} Page HTML.
154
+ */
155
+ async function loadPage(url, timeoutMs) {
156
+ const cached = pageCache.get(url)
157
+ if (cached !== undefined) return cached
158
+ const response = await fetch(url, {
159
+ signal: AbortSignal.timeout(timeoutMs),
160
+ headers: { 'user-agent': 'dsh-unreal-python-api' },
161
+ })
162
+ if (!response.ok) throw new Error(`HTTP ${response.status} for ${url}`)
163
+ const html = await response.text()
164
+ if (html.length > MAX_PAGE_BYTES) throw new Error(`page at ${url} exceeds the accepted size`)
165
+ if (pageCache.size >= PAGE_CACHE_LIMIT) {
166
+ const oldest = pageCache.keys().next().value
167
+ pageCache.delete(oldest)
168
+ }
169
+ pageCache.set(url, html)
170
+ return html
171
+ }
172
+
173
+ /**
174
+ * Read the exact syntax documented for one symbol.
175
+ *
176
+ * @param {{docBaseUrl: string, symbol: string, uri: string, kind: string, timeoutMs: number}} options Read options.
177
+ * @returns {Promise<object>} Entry with signature, description, parameters, returns, url, and what was resolved.
178
+ */
179
+ export async function readSymbolDoc({ docBaseUrl, symbol, uri, kind, timeoutMs }) {
180
+ const url = pageUrl(docBaseUrl, uri, symbol)
181
+ const html = await loadPage(url, timeoutMs)
182
+ const entry = extractSymbol(html, symbol)
183
+ return {
184
+ symbol,
185
+ kind,
186
+ url,
187
+ resolved: entry !== null,
188
+ signature: entry?.signature ?? '',
189
+ description: entry?.description ?? '',
190
+ parameters: entry?.parameters ?? [],
191
+ returns: entry?.returns ?? '',
192
+ note: entry === null
193
+ ? 'the documentation page does not carry an anchor for this symbol; open the URL for its page'
194
+ : '',
195
+ }
196
+ }
@@ -0,0 +1,304 @@
1
+ /**
2
+ * Unreal Engine Python API symbol inventory.
3
+ *
4
+ * Reads the Sphinx `objects.inv` published beside the Unreal Engine Python API
5
+ * documentation and keeps it in a local cache. Listing and searching then cost
6
+ * no network round trip beyond the first load, and every returned row carries
7
+ * the documentation page that describes it.
8
+ *
9
+ * @module dsh-unreal-python-api/inventory
10
+ */
11
+
12
+ import { mkdir, readFile, rename, stat, writeFile } from 'node:fs/promises'
13
+ import { homedir } from 'node:os'
14
+ import { join } from 'node:path'
15
+ import zlib from 'node:zlib'
16
+
17
+ /** Published documentation root for the Unreal Engine Python API. */
18
+ export const DEFAULT_DOC_BASE_URL = 'https://dev.epicgames.com/documentation/en-us/unreal-engine/python-api/'
19
+
20
+ /** Inventory file name Sphinx publishes next to the documentation pages. */
21
+ const INVENTORY_FILE = 'objects.inv'
22
+
23
+ /** Local cache file name for the downloaded inventory. */
24
+ const CACHE_FILE = 'unreal-python-objects.inv'
25
+
26
+ /** Header lines Sphinx writes before the zlib-compressed body. */
27
+ const HEADER_LINES = 4
28
+
29
+ /** Caller-facing kind aliases mapped onto the Sphinx role names. */
30
+ const KIND_ALIASES = new Map([
31
+ ['class', 'py:class'],
32
+ ['method', 'py:method'],
33
+ ['property', 'py:property'],
34
+ ['attribute', 'py:attribute'],
35
+ ['function', 'py:function'],
36
+ ['doc', 'std:doc'],
37
+ ['label', 'std:label'],
38
+ ])
39
+
40
+ /** Sphinx role names mapped onto caller-facing kind names. */
41
+ const FRIENDLY_KINDS = new Map([
42
+ ['py:class', 'class'],
43
+ ['py:method', 'method'],
44
+ ['py:property', 'property'],
45
+ ['py:attribute', 'attribute'],
46
+ ['py:function', 'function'],
47
+ ['std:doc', 'doc'],
48
+ ['std:label', 'label'],
49
+ ])
50
+
51
+ /**
52
+ * Resolve a caller-supplied kind to its Sphinx role name.
53
+ * @param {string | undefined} kind Caller-supplied kind or alias.
54
+ * @returns {string | undefined} Sphinx role name, or undefined for no filter.
55
+ */
56
+ export function resolveKind(kind) {
57
+ if (kind === undefined || kind === null || kind === '') return undefined
58
+ const raw = String(kind).trim().toLowerCase()
59
+ if (KIND_ALIASES.has(raw)) return KIND_ALIASES.get(raw)
60
+ for (const role of FRIENDLY_KINDS.keys()) if (role === raw) return role
61
+ throw new Error(`unknown kind '${kind}'; use class, method, property, attribute, function, doc, or label`)
62
+ }
63
+
64
+ /**
65
+ * Name a Sphinx role for callers.
66
+ * @param {string} role Sphinx role name.
67
+ * @returns {string} Caller-facing kind name.
68
+ */
69
+ export function friendlyKind(role) {
70
+ return FRIENDLY_KINDS.get(role) ?? role
71
+ }
72
+
73
+ /**
74
+ * Resolve the directory holding the cached inventory.
75
+ * @param {string} [configured] Configured directory, when set.
76
+ * @returns {string} Absolute cache directory.
77
+ */
78
+ export function resolveCacheDir(configured) {
79
+ if (configured) return configured
80
+ const fromEnvironment = process.env.DSH_UNREAL_PYTHON_API_CACHE
81
+ if (fromEnvironment) return fromEnvironment
82
+ if (process.platform === 'win32' && process.env.LOCALAPPDATA) {
83
+ return join(process.env.LOCALAPPDATA, 'dsh-unreal-python-api')
84
+ }
85
+ if (process.env.XDG_CACHE_HOME) return join(process.env.XDG_CACHE_HOME, 'dsh-unreal-python-api')
86
+ return join(homedir(), '.cache', 'dsh-unreal-python-api')
87
+ }
88
+
89
+ /**
90
+ * Build the documentation URL for an inventory URI.
91
+ *
92
+ * Sphinx writes `#$` when the entry's anchor is its own symbol name, so passing
93
+ * the symbol lands the reader on the member rather than the top of the page.
94
+ *
95
+ * @param {string} docBaseUrl Documentation root.
96
+ * @param {string} uri Inventory-relative URI, possibly with a fragment.
97
+ * @param {string} [symbol] Symbol name, used when the URI carries the `#$` placeholder.
98
+ * @returns {string} Absolute URL.
99
+ */
100
+ export function pageUrl(docBaseUrl, uri, symbol) {
101
+ const base = docBaseUrl.endsWith('/') ? docBaseUrl : `${docBaseUrl}/`
102
+ const [path, fragment] = String(uri).split('#')
103
+ if (fragment === undefined || fragment === '') return base + path
104
+ if (fragment !== '$') return `${base}${path}#${fragment}`
105
+ return symbol ? `${base}${path}#${symbol}` : base + path
106
+ }
107
+
108
+ /**
109
+ * Inflate and parse an `objects.inv` byte payload into parallel arrays.
110
+ *
111
+ * Each inventory line is `name role priority uri displayname`; the display name
112
+ * is last and may contain spaces, so only the first four fields are read.
113
+ *
114
+ * @param {Buffer} payload Raw inventory bytes including the header.
115
+ * @returns {{version: string, names: string[], lower: string[], kinds: string[], uris: string[], index: Map<string, number>}} Parsed inventory.
116
+ */
117
+ export function parseInventory(payload) {
118
+ const header = []
119
+ let offset = 0
120
+ for (let line = 0; line < HEADER_LINES; line += 1) {
121
+ const newline = payload.indexOf(10, offset)
122
+ if (newline < 0) throw new Error('objects.inv ended inside its header')
123
+ header.push(payload.subarray(offset, newline).toString('utf8'))
124
+ offset = newline + 1
125
+ }
126
+ const versionLine = header.find((line) => line.startsWith('# Version:'))
127
+ const version = versionLine ? versionLine.slice('# Version:'.length).trim() : 'unknown'
128
+ const body = zlib.inflateSync(payload.subarray(offset)).toString('utf8')
129
+
130
+ const names = []
131
+ const kinds = []
132
+ const uris = []
133
+ for (const line of body.split('\n')) {
134
+ if (line === '') continue
135
+ const parts = line.split(' ')
136
+ if (parts.length < 5) continue
137
+ names.push(parts[0])
138
+ kinds.push(parts[1])
139
+ uris.push(parts[3])
140
+ }
141
+ const lower = names.map((name) => name.toLowerCase())
142
+ const index = new Map()
143
+ for (let position = 0; position < names.length; position += 1) {
144
+ if (!index.has(names[position])) index.set(names[position], position)
145
+ }
146
+ return { version, names, lower, kinds, uris, index }
147
+ }
148
+
149
+ /**
150
+ * Count symbols per kind.
151
+ * @param {object} inventory Parsed inventory.
152
+ * @returns {Array<{kind: string, count: number}>} Counts, largest first.
153
+ */
154
+ export function summarize(inventory) {
155
+ const counts = new Map()
156
+ for (const role of inventory.kinds) {
157
+ const kind = friendlyKind(role)
158
+ counts.set(kind, (counts.get(kind) ?? 0) + 1)
159
+ }
160
+ return [...counts.entries()]
161
+ .map(([kind, count]) => ({ kind, count }))
162
+ .sort((left, right) => right.count - left.count || left.kind.localeCompare(right.kind))
163
+ }
164
+
165
+ /**
166
+ * List the direct members of a namespace or class.
167
+ * @param {object} inventory Parsed inventory.
168
+ * @param {{parent: string, kind?: string, limit: number}} options Listing options.
169
+ * @returns {{total: number, rows: Array<{name: string, kind: string, url: string}>, counts: Array<{kind: string, count: number}>, truncated: boolean}} Listing result.
170
+ */
171
+ export function listChildren(inventory, { parent, kind, limit }) {
172
+ const wanted = resolveKind(kind)
173
+ const trimmed = String(parent).trim()
174
+ if (trimmed === '') throw new Error('parent must not be empty')
175
+ const prefix = trimmed.endsWith('.') ? trimmed : `${trimmed}.`
176
+ const counts = new Map()
177
+ const rows = []
178
+ let total = 0
179
+ for (let position = 0; position < inventory.names.length; position += 1) {
180
+ const name = inventory.names[position]
181
+ if (!name.startsWith(prefix)) continue
182
+ const rest = name.slice(prefix.length)
183
+ if (rest === '' || rest.includes('.')) continue
184
+ total += 1
185
+ const friendly = friendlyKind(inventory.kinds[position])
186
+ counts.set(friendly, (counts.get(friendly) ?? 0) + 1)
187
+ if (wanted !== undefined && inventory.kinds[position] !== wanted) continue
188
+ if (rows.length < limit) {
189
+ rows.push({ name, kind: friendly, url: pageUrl(inventory.docBaseUrl, inventory.uris[position], name) })
190
+ }
191
+ }
192
+ return {
193
+ total,
194
+ rows,
195
+ counts: [...counts.entries()].map(([name, count]) => ({ kind: name, count })).sort((left, right) => right.count - left.count),
196
+ truncated: total > rows.length,
197
+ }
198
+ }
199
+
200
+ /**
201
+ * Search symbols by name.
202
+ *
203
+ * Ranking: exact name, case-insensitive exact, member-name prefix (so
204
+ * `set_actor` reaches `unreal.Actor.set_actor_scale3d`), then any substring.
205
+ *
206
+ * @param {object} inventory Parsed inventory.
207
+ * @param {{query: string, kind?: string, parent?: string, limit: number}} options Search options.
208
+ * @returns {{matches: Array<{name: string, kind: string, url: string}>, total: number, truncated: boolean}} Search result.
209
+ */
210
+ export function searchSymbols(inventory, { query, kind, parent, limit }) {
211
+ const wanted = resolveKind(kind)
212
+ const needle = String(query).trim()
213
+ if (needle === '') throw new Error('query must not be empty')
214
+ const lowered = needle.toLowerCase()
215
+ const prefix = parent === undefined || parent === '' ? '' : (() => {
216
+ const trimmed = String(parent).trim()
217
+ return trimmed.endsWith('.') ? trimmed : `${trimmed}.`
218
+ })()
219
+
220
+ const exact = []
221
+ const caseInsensitive = []
222
+ const memberPrefix = []
223
+ const substring = []
224
+ const cap = limit * 8
225
+ let total = 0
226
+
227
+ for (let position = 0; position < inventory.names.length; position += 1) {
228
+ if (wanted !== undefined && inventory.kinds[position] !== wanted) continue
229
+ const name = inventory.names[position]
230
+ if (prefix !== '' && !name.startsWith(prefix)) continue
231
+ const lower = inventory.lower[position]
232
+ const member = lower.slice(lower.lastIndexOf('.') + 1)
233
+ let bucket = null
234
+ if (name === needle) bucket = exact
235
+ else if (lower === lowered) bucket = caseInsensitive
236
+ else if (member.startsWith(lowered)) bucket = memberPrefix
237
+ else if (lower.includes(lowered)) bucket = substring
238
+ if (bucket === null) continue
239
+ total += 1
240
+ if (exact.length + caseInsensitive.length + memberPrefix.length + substring.length < cap) bucket.push(position)
241
+ }
242
+
243
+ const ordered = [...exact, ...caseInsensitive, ...memberPrefix, ...substring]
244
+ const shown = ordered.slice(0, limit)
245
+ return {
246
+ matches: shown.map((position) => ({
247
+ name: inventory.names[position],
248
+ kind: friendlyKind(inventory.kinds[position]),
249
+ url: pageUrl(inventory.docBaseUrl, inventory.uris[position], inventory.names[position]),
250
+ })),
251
+ total,
252
+ truncated: total > shown.length,
253
+ }
254
+ }
255
+
256
+ /**
257
+ * Download the inventory when the cache is missing or stale, then parse it.
258
+ *
259
+ * A stale cache is preferable to no inventory, so a failed refresh falls back
260
+ * to whatever the cache already holds.
261
+ *
262
+ * @param {{docBaseUrl: string, cacheDir: string, refreshHours: number, timeoutMs: number}} options Load options.
263
+ * @returns {Promise<{inventory: object, version: string, source: string, url: string, cacheFile: string}>} Loaded inventory and provenance.
264
+ */
265
+ export async function loadInventory({ docBaseUrl, cacheDir, refreshHours, timeoutMs }) {
266
+ const file = join(cacheDir, CACHE_FILE)
267
+ const url = new URL(INVENTORY_FILE, docBaseUrl.endsWith('/') ? docBaseUrl : `${docBaseUrl}/`).href
268
+ let payload = null
269
+ let source = 'cache'
270
+
271
+ try {
272
+ const info = await stat(file)
273
+ const maxAgeMs = refreshHours * 3_600_000
274
+ if (refreshHours > 0 && Date.now() - info.mtimeMs < maxAgeMs) payload = await readFile(file)
275
+ } catch {
276
+ payload = null
277
+ }
278
+
279
+ if (payload === null) {
280
+ try {
281
+ const response = await fetch(url, {
282
+ signal: AbortSignal.timeout(timeoutMs),
283
+ headers: { 'user-agent': 'dsh-unreal-python-api' },
284
+ })
285
+ if (!response.ok) throw new Error(`HTTP ${response.status}`)
286
+ payload = Buffer.from(await response.arrayBuffer())
287
+ await mkdir(cacheDir, { recursive: true })
288
+ await writeFile(`${file}.tmp`, payload)
289
+ await rename(`${file}.tmp`, file)
290
+ source = 'network'
291
+ } catch (error) {
292
+ try {
293
+ payload = await readFile(file)
294
+ source = 'stale-cache'
295
+ } catch {
296
+ throw new Error(`cannot read the Unreal Python API inventory from ${url}: ${error.message}`)
297
+ }
298
+ }
299
+ }
300
+
301
+ const inventory = parseInventory(payload)
302
+ inventory.docBaseUrl = docBaseUrl
303
+ return { inventory, version: inventory.version, source, url, cacheFile: file }
304
+ }
package/link-deps.ps1 ADDED
@@ -0,0 +1,36 @@
1
+ # Recreates the node_modules links this plugin needs to import the DSH runtime
2
+ # packages (@deepseek-ai/dsh-tools, @deepseek-ai/schemastery).
3
+ #
4
+ # Why this exists: the profile installs the plugin as a junction, so Node resolves
5
+ # index.js through its real path on this checkout. Node's lookup walks up from the
6
+ # checkout directory and therefore never reaches the DSH install on C:, so the two
7
+ # packages are linked into the checkout's own node_modules instead.
8
+ #
9
+ # Run this after moving the checkout or after a DSH reinstall.
10
+ [CmdletBinding()]
11
+ param(
12
+ [string]$InstallRoot = $env:DSH_INSTALL_DIR
13
+ )
14
+
15
+ $ErrorActionPreference = 'Stop'
16
+
17
+ if (-not $InstallRoot) { $InstallRoot = Join-Path $env:USERPROFILE 'node_modules\@deepseek-ai\dsh' }
18
+ $scope = Split-Path -Parent $InstallRoot
19
+ $packageRoot = $PSScriptRoot
20
+ $modules = Join-Path $packageRoot 'node_modules\@deepseek-ai'
21
+
22
+ New-Item -ItemType Directory -Force -Path $modules | Out-Null
23
+
24
+ foreach ($name in @('dsh-tools', 'schemastery')) {
25
+ $target = Join-Path $scope $name
26
+ if (-not (Test-Path (Join-Path $target 'package.json'))) {
27
+ throw "DSH package not found: $target (pass -InstallRoot pointing at the dsh package)"
28
+ }
29
+ $link = Join-Path $modules $name
30
+ if (Test-Path $link) { Remove-Item $link -Force -Recurse }
31
+ New-Item -ItemType Junction -Path $link -Target $target | Out-Null
32
+ Write-Host "linked $name -> $target"
33
+ }
34
+
35
+ Write-Host "Import check:"
36
+ node -e "console.log(' dsh-tools ', require.resolve('@deepseek-ai/dsh-tools/package.json')); console.log(' schemastery ', require.resolve('@deepseek-ai/schemastery/package.json'))"
package/locale/en.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Unreal Python API context",
4
+ "description": "Gives agents the Unreal Engine Python API: list and search the documented symbols, read exact signatures from the Epic documentation, and scaffold ToolsetRegistry tools whose Unreal API calls are verified against the published symbol inventory.",
5
+ "detail": "docs/DETAIL.md"
6
+ }
7
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Unreal Python API 上下文",
4
+ "description": "为 Agent 提供 Unreal Engine Python API:列出并搜索已收录的符号、从 Epic 文档读取精确签名,并基于已校验的符号清单生成 ToolsetRegistry 工具骨架。",
5
+ "detail": "docs/DETAIL.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "dsh-unreal-python-api",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "Unreal Engine Python API context for DSH agents: symbol inventory listing, symbol search, exact syntax from the Epic docs, and tool scaffolding in four styles (ToolsetRegistry toolset, editor script, MCP tool descriptors, DSH defineTool module).",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "dsh",
9
+ "dsh-plugin",
10
+ "deepseek-harness",
11
+ "unreal-engine",
12
+ "unreal-python",
13
+ "toolset",
14
+ "mcp"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "exports": {
23
+ ".": "./index.js",
24
+ "./locale/*.json": "./locale/*.json",
25
+ "./icon": "./icon.svg"
26
+ },
27
+ "files": [
28
+ "index.js",
29
+ "lib",
30
+ "cordis.patch.yml",
31
+ "locale/*.json",
32
+ "docs",
33
+ "test",
34
+ "icon.svg",
35
+ "README.md",
36
+ "LICENSE",
37
+ "CHANGELOG.md",
38
+ "link-deps.ps1"
39
+ ],
40
+ "dsh": {
41
+ "bundle": {
42
+ "patch": "./cordis.patch.yml"
43
+ }
44
+ },
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/TaimoorSiddiquiOfficial/dsh-unreal-python-api.git"
48
+ },
49
+ "homepage": "https://github.com/TaimoorSiddiquiOfficial/dsh-unreal-python-api#readme",
50
+ "bugs": {
51
+ "url": "https://github.com/TaimoorSiddiquiOfficial/dsh-unreal-python-api/issues"
52
+ }
53
+ }