dsh-unreal-python-api 1.1.1 → 1.2.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 — 2026-11-30
4
+
5
+ - Split the tools into two tiers. **general** — `unreal_python_tools_list`,
6
+ `unreal_python_search`, `unreal_python_syntax` — register unconditionally and
7
+ are offered in every workspace. **development** — `unreal_python_tool_builder`
8
+ — is admitted only inside `scope`, so a normal workspace keeps the lookups and
9
+ the code-generating tool appears only where you develop. `scope: anywhere`
10
+ (the default) still offers everything everywhere.
11
+ - The prompt section now names the general tier and says where the development
12
+ tier applies instead of implying all four tools behave alike.
13
+ - Tests assert the tier split: three unconditional tools, exactly one gated, and
14
+ the gated one is the builder.
15
+
3
16
  ## 1.1.1 — 2026-11-30
4
17
 
5
18
  - Fixed the test suite on a machine without the harness packages: the export,
package/README.md CHANGED
@@ -129,19 +129,24 @@ locale/, icon.svg Host display metadata
129
129
  | `maxResults` | `30` | Upper bound on rows a tool returns. |
130
130
  | `fetchTimeoutMs` | `30000` | Page and inventory timeout. |
131
131
  | `promptSection` | `true` | Register the system-prompt section. |
132
- | `scope` | `anywhere` | Where the tools are offered: `anywhere`, `unreal-project`, or `workspaces`. |
132
+ | `scope` | `anywhere` | Where the development tier is offered: `anywhere`, `unreal-project`, or `workspaces`. |
133
133
  | `workspaces` | `[]` | Absolute roots admitted by `scope: workspaces`. |
134
134
  | `projectMarkers` | `['.uproject']` | Files that identify a project root; replaces the default list. |
135
135
 
136
- ### Workspace scoping
136
+ ### Two tiers, and workspace scoping
137
137
 
138
- One profile install serves every workspace, so the four tools are offered
139
- everywhere by default. Set `scope` to make them appear only where they are
140
- useful:
138
+ One profile install serves every workspace, so the tools come in two tiers:
141
139
 
142
- | `scope` | Tools are offered when |
140
+ | Tier | Tools | Offered |
141
+ |---|---|---|
142
+ | general | `unreal_python_tools_list`, `unreal_python_search`, `unreal_python_syntax` | every workspace, always |
143
+ | development | `unreal_python_tool_builder` | only inside `scope` |
144
+
145
+ `scope` decides where the development tier is admitted:
146
+
147
+ | `scope` | The development tier is offered when |
143
148
  |---|---|
144
- | `anywhere` (default) | always — unchanged from 1.0.0 |
149
+ | `anywhere` (default) | always — the 1.0/1.1 behaviour, nothing gated |
145
150
  | `unreal-project` | the session's working directory, or a parent, holds a `*.uproject` |
146
151
  | `workspaces` | the working directory is inside one of the `workspaces` roots |
147
152
 
@@ -149,19 +154,18 @@ useful:
149
154
  # the dsh-unreal-python-api row's config (profile cordis.patch.yml, or the
150
155
  # plugin's settings panel in the GUI when it offers one)
151
156
  config:
152
- scope: unreal-project
153
- # or name the roots yourself:
154
- # scope: workspaces
155
- # workspaces:
156
- # - D:\HOP TRENDY UNREAL\Unreal Projects\TDA
157
+ scope: workspaces
158
+ workspaces:
159
+ - D:\HOP TRENDY UNREAL\Unreal Projects\TDA
157
160
  ```
158
161
 
159
162
  The check runs once per prepared step against the session's committed working
160
163
  directory, is cached for ten seconds, and never throws: an unknown directory or
161
- a failing lookup counts as not admitted. Path comparison is segment-aware and
164
+ a failing lookup counts as not admitted. Comparison is segment-aware and
162
165
  case-insensitive, so `…\TDA` admits `…\TDA\Source` but not `…\TDA2`. Outside the
163
- scope the tools are absent from the model's tool list entirely rather than
164
- refused at call time, and the prompt section says where they apply.
166
+ scope the development tool is absent from the model's tool list entirely rather
167
+ than refused at call time, and the prompt section says so. The general tier is
168
+ never gated, so documentation lookups keep working in every workspace.
165
169
 
166
170
  ## Publishing to the market
167
171
 
package/docs/DETAIL.md CHANGED
@@ -66,13 +66,18 @@ grounded starting point, not finished code.
66
66
  | `maxResults` | `30` | Default row cap per call; a caller may ask for fewer or more, up to 200. |
67
67
  | `fetchTimeoutMs` | `30000` | Per-request timeout for the inventory and documentation pages. |
68
68
  | `promptSection` | `true` | Adds one line to the system prompt naming the tools and the documentation root. |
69
- | `scope` | `anywhere` | `anywhere`, `unreal-project`, or `workspaces`; see the scope gate below. |
69
+ | `scope` | `anywhere` | `anywhere`, `unreal-project`, or `workspaces`; where the development tier is admitted. |
70
70
  | `workspaces` | `[]` | Absolute roots admitted by `scope: workspaces`; required by that mode. |
71
71
  | `projectMarkers` | `['.uproject']` | File names (or `.extension` suffixes) that mark a project root. Replaces, never extends, the default. |
72
72
 
73
73
  ### Scope gate
74
74
 
75
- `scope` is enforced with the tool runtime's step-time activation condition —
75
+ The tools form two tiers. `unreal_python_tools_list`, `unreal_python_search` and
76
+ `unreal_python_syntax` are general: they register unconditionally and stay
77
+ available in every workspace. `unreal_python_tool_builder` is development: it
78
+ writes code, so it is the tool `scope` gates.
79
+
80
+ Gating uses the tool runtime's step-time activation condition —
76
81
  `ctx.tools.register(definition, { when })`, where `when` receives the preparing
77
82
  agent. The plugin reads the session's committed working directory through the
78
83
  `workingDirectory` service (`ctx.workingDirectory.get(agent.session)`), so the
package/index.js CHANGED
@@ -156,11 +156,14 @@ export function apply(ctx, config) {
156
156
  }
157
157
  },
158
158
  })
159
- // A scope condition must never fail step preparation, so only a non-default
160
- // scope attaches one; the default registers exactly as before.
161
- const register =
159
+ // Two tiers: the general lookup tools are offered in every workspace, the
160
+ // development tools (scaffold generation) only inside the configured scope.
161
+ // A condition must never fail step preparation, so the default scope attaches
162
+ // none and the general tier never carries one.
163
+ const registerGeneral = (definition) => ctx.tools.register(definition)
164
+ const registerDevelopment =
162
165
  scope.scope === 'anywhere'
163
- ? (definition) => ctx.tools.register(definition)
166
+ ? registerGeneral
164
167
  : (definition) => ctx.tools.register(definition, { when: (context) => gate.admits(context.agent) })
165
168
 
166
169
  let loaded = null
@@ -185,7 +188,7 @@ export function apply(ctx, config) {
185
188
  return loaded
186
189
  }
187
190
 
188
- register(defineTool({
191
+ registerGeneral(defineTool({
189
192
  name: 'unreal_python_tools_list',
190
193
  description: 'List Unreal Engine Python API symbols. Without a parent it reports how many symbols the published documentation holds and their kinds; with a parent such as unreal.Actor it lists that namespace or class direct members.',
191
194
  parameters: {
@@ -250,7 +253,7 @@ export function apply(ctx, config) {
250
253
  },
251
254
  }))
252
255
 
253
- register(defineTool({
256
+ registerGeneral(defineTool({
254
257
  name: 'unreal_python_search',
255
258
  description: 'Search Unreal Python API symbol names. Ranks an exact name first, then a member name that starts with the query, then any containing name, and returns each match with its documentation URL.',
256
259
  parameters: {
@@ -301,7 +304,7 @@ export function apply(ctx, config) {
301
304
  },
302
305
  }))
303
306
 
304
- register(defineTool({
307
+ registerGeneral(defineTool({
305
308
  name: 'unreal_python_syntax',
306
309
  description: 'Return the exact documented syntax of Unreal Python symbols: signature, description, parameters, and return value, read from the published documentation page that carries the symbol.',
307
310
  parameters: {
@@ -409,7 +412,7 @@ export function apply(ctx, config) {
409
412
  },
410
413
  }))
411
414
 
412
- register(defineTool({
415
+ registerDevelopment(defineTool({
413
416
  name: 'unreal_python_tool_builder',
414
417
  description: 'Scaffold an Unreal Python tool from a description plus verified API symbols. Styles: toolset (a ToolsetRegistry toolset class with its test module), editor_script (a plain editor script), mcp_tool (MCP tool descriptors in JSON plus the Python handler module that serves them), and dsh_tool (a DSH plugin tool module whose definitions register through defineTool, with a Node test module). Every Unreal API symbol the tool asks for is verified against the published inventory and recorded with its documentation URL; unverified symbols are reported instead of written into the code.',
415
418
  parameters: {
@@ -532,7 +535,7 @@ export function apply(ctx, config) {
532
535
  text:
533
536
  scope.scope === 'anywhere'
534
537
  ? `Unreal Python API (published 5.8 documentation): unreal_python_tools_list and unreal_python_search find documented symbols, unreal_python_syntax returns their exact signatures and parameters, and unreal_python_tool_builder scaffolds a tool from verified symbols in one of four styles — a ToolsetRegistry toolset, an editor script, MCP tool descriptors with their Python handlers, or a DSH tool module built on defineTool. Documentation root: ${docBaseUrl}`
535
- : `Unreal Python API (published 5.8 documentation). The unreal_python_* tools are admitted only inside ${describeScope(scope)}; in other workspaces they are not offered. Inside one they list documented symbols, search them, return exact signatures and parameters, and scaffold tools from verified symbols in four styles. Documentation root: ${docBaseUrl}`,
538
+ : `Unreal Python API (published 5.8 documentation): unreal_python_tools_list, unreal_python_search and unreal_python_syntax are available here; unreal_python_tool_builder is admitted only inside ${describeScope(scope)}, so it is absent when you work elsewhere. Documentation root: ${docBaseUrl}`,
536
539
  })
537
540
  }
538
541
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-unreal-python-api",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
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
6
  "license": "MIT",
package/test/smoke.mjs CHANGED
@@ -315,12 +315,19 @@ assert.equal(openContext.sections.length, 1, 'default scope registers one prompt
315
315
  const scopedContext = fakeContext((session) => (session.id === 'inside' ? join(TDA, 'Source') : 'D:\\elsewhere'))
316
316
  plugin.apply(scopedContext, plugin.Config({ scope: 'workspaces', workspaces: [TDA] }))
317
317
  assert.equal(scopedContext.registered.length, 4, 'a scoped install still registers four tools')
318
- assert.ok(scopedContext.registered.every((entry) => typeof entry.options.when === 'function'), 'a scoped install attaches a condition')
319
- const condition = scopedContext.registered[0].options.when
318
+ const gated = scopedContext.registered.filter((entry) => typeof entry.options.when === 'function')
319
+ assert.equal(gated.length, 1, 'only the development tier is gated')
320
+ assert.equal(gated[0].definition.name, 'unreal_python_tool_builder', 'the development tier is the tool builder')
321
+ const general = scopedContext.registered
322
+ .filter((entry) => entry.options.when === undefined)
323
+ .map((entry) => entry.definition.name)
324
+ .sort()
325
+ assert.deepEqual(general, ['unreal_python_search', 'unreal_python_syntax', 'unreal_python_tools_list'], 'the general tier carries no condition')
326
+ const condition = gated[0].options.when
320
327
  assert.equal(await condition({ agent: { session: { id: 'inside' } } }), true, 'the condition admits the configured workspace')
321
328
  assert.equal(await condition({ agent: { session: { id: 'outside' } } }), false, 'the condition rejects another workspace')
322
- assert.match(scopedContext.sections[0].text, /admitted only inside/, 'the prompt section says where the tools apply')
323
- console.log('apply(): default and scoped registration: OK')
329
+ assert.match(scopedContext.sections[0].text, /admitted only inside/, 'the prompt section says where the development tool applies')
330
+ console.log('apply(): general tier always on, development tier scoped: OK')
324
331
  }
325
332
 
326
333
  // --- every generated artifact must parse in its own language -------------------