unity-agentic-tools 0.2.0 → 0.3.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/native/index.d.ts CHANGED
@@ -90,6 +90,7 @@ export interface PaginationOptions {
90
90
  export interface PaginatedInspection {
91
91
  file: string
92
92
  total: number
93
+ totalInScene: number
93
94
  cursor: number
94
95
  nextCursor?: number | undefined
95
96
  truncated: boolean
@@ -135,6 +136,84 @@ export interface SearchResult {
135
136
  score: number
136
137
  metadata: ChunkMetadata
137
138
  }
139
+ /**
140
+ * Extract type names from a single .NET DLL.
141
+ *
142
+ * Returns public types with their name and namespace.
143
+ * GUID is always None for DLL types (they have no .meta files).
144
+ */
145
+ export declare function extractDllTypes(path: string): Array<CSharpTypeRef>
146
+ /**
147
+ * Extract type info with fields from a single .NET DLL.
148
+ *
149
+ * Returns extended type info including serializable fields, base class,
150
+ * and struct/enum distinction via the Extends column.
151
+ */
152
+ export declare function extractDllFields(path: string): Array<CSharpTypeInfo>
153
+ /** A serializable field extracted from a C# type. */
154
+ export interface CSharpFieldRef {
155
+ /** Field name (e.g., "health", "moveSpeed") */
156
+ name: string
157
+ /** C# type name (e.g., "int", "Vector3", "List<string>", "GameObject") */
158
+ typeName: string
159
+ /** Whether [SerializeField] attribute is present */
160
+ hasSerializeField: boolean
161
+ /** Whether [SerializeReference] attribute is present */
162
+ hasSerializeReference: boolean
163
+ /** Whether the field is public */
164
+ isPublic: boolean
165
+ /** Which type this field belongs to (e.g., "PlayerController") */
166
+ ownerType: string
167
+ }
168
+ /** Extended type info with fields and base class, extracted on demand. */
169
+ export interface CSharpTypeInfo {
170
+ /** Type name (e.g., "PlayerController") */
171
+ name: string
172
+ /** Kind: "class", "struct", "enum", or "interface" */
173
+ kind: string
174
+ /** Namespace (e.g., "UnityEngine.UI") */
175
+ namespace?: string
176
+ /** Base class (e.g., "MonoBehaviour", "ScriptableObject") */
177
+ baseClass?: string
178
+ /** Serializable fields */
179
+ fields: Array<CSharpFieldRef>
180
+ }
181
+ /** A C# type reference extracted from source or DLL. */
182
+ export interface CSharpTypeRef {
183
+ /** Type name (e.g., "PlayerController") */
184
+ name: string
185
+ /** Kind: "class", "struct", "enum", or "interface" */
186
+ kind: string
187
+ /** Namespace (e.g., "UnityEngine.UI") */
188
+ namespace?: string
189
+ /** Source file or DLL path (relative to project root) */
190
+ filePath: string
191
+ /** GUID from adjacent .meta file (None for DLL types) */
192
+ guid?: string
193
+ }
194
+ /**
195
+ * Extract C# type declarations from a single .cs file.
196
+ *
197
+ * Returns all public/internal class, struct, enum, and interface declarations
198
+ * with their namespace context and the GUID from the adjacent .meta file.
199
+ */
200
+ export declare function extractCsharpTypes(path: string): Array<CSharpTypeRef>
201
+ /**
202
+ * Build a type registry by scanning all .cs files in a Unity project.
203
+ *
204
+ * Scans Assets/ and optionally Library/PackageCache/ for .cs files,
205
+ * extracts type declarations, and returns them with GUID + namespace info.
206
+ * When include_packages is true, also scans Library/PackageCache/.
207
+ * When include_dlls is true, also extracts types from DLLs in Library/ScriptAssemblies/.
208
+ */
209
+ export declare function buildTypeRegistry(projectRoot: string, includePackages?: boolean | undefined | null, includeDlls?: boolean | undefined | null): Array<CSharpTypeRef>
210
+ /**
211
+ * Extract serialized field info from a single C# source file.
212
+ *
213
+ * Returns extended type info with fields, base class, and serialization attributes.
214
+ * This is called on-demand during component creation, not during registry builds.
215
+ */
216
+ export declare function extractSerializedFields(path: string): Array<CSharpTypeInfo>
138
217
  /**
139
218
  * Walk a Unity project and collect files matching the given extensions.
140
219
  *
@@ -174,6 +253,14 @@ export declare function grepProject(options: NapiGrepOptions): NapiGrepResult
174
253
  * Returns a JSON object mapping `{ guid: relative_asset_path }`.
175
254
  */
176
255
  export declare function buildGuidCache(projectRoot: string): any
256
+ /**
257
+ * Build a GUID cache for Library/PackageCache/ contents.
258
+ *
259
+ * Scans `Library/PackageCache/` for `.meta` files and returns
260
+ * `{ guid: relative_path }` just like `build_guid_cache` does for Assets/.
261
+ * Returns a separate cache so project assets and package assets stay distinct.
262
+ */
263
+ export declare function buildPackageGuidCache(projectRoot: string): any
177
264
  /** Get the version of the native module */
178
265
  export declare function getVersion(): string
179
266
  /** Check if the native module is available */
@@ -191,6 +278,11 @@ export declare class Scanner {
191
278
  scanSceneMinimal(file: string): Array<GameObject>
192
279
  /** Scan scene with component information */
193
280
  scanSceneWithComponents(file: string, options?: ScanOptions | undefined | null): Array<any>
281
+ /**
282
+ * Scan scene for GO metadata (name, tag, layer) without component/hierarchy extraction.
283
+ * This is the "medium path" — faster than scan_scene_with_components for tag/layer filtering.
284
+ */
285
+ scanSceneMetadata(file: string): Array<any>
194
286
  /** Find GameObjects and PrefabInstances by name pattern */
195
287
  findByName(file: string, pattern: string, fuzzy: boolean): Array<FindResult>
196
288
  /** Inspect a specific GameObject */
@@ -199,8 +291,12 @@ export declare class Scanner {
199
291
  inspectAll(file: string, includeProperties: boolean, verbose: boolean): SceneInspection
200
292
  /** Inspect entire file with pagination support */
201
293
  inspectAllPaginated(options: PaginationOptions): PaginatedInspection
202
- /** Read a .asset file and return its root objects with properties */
203
- readAsset(file: string): any
294
+ /**
295
+ * Read a .asset file and return its root objects with properties.
296
+ * When `decode_mesh` is true (default), Mesh assets (class 43) get their
297
+ * hex vertex/index data decoded into structured arrays.
298
+ */
299
+ readAsset(file: string, decodeMesh?: boolean | undefined | null): any
204
300
  }
205
301
  /** High-performance documentation indexer */
206
302
  export declare class Indexer {
package/native/index.js CHANGED
@@ -310,14 +310,20 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { ChunkType, Scanner, Indexer, EmbeddingGenerator, walkProjectFiles, grepProject, buildGuidCache, getVersion, isNativeAvailable } = nativeBinding
313
+ const { ChunkType, extractDllTypes, extractDllFields, extractCsharpTypes, buildTypeRegistry, extractSerializedFields, Scanner, Indexer, EmbeddingGenerator, walkProjectFiles, grepProject, buildGuidCache, buildPackageGuidCache, getVersion, isNativeAvailable } = nativeBinding
314
314
 
315
315
  module.exports.ChunkType = ChunkType
316
+ module.exports.extractDllTypes = extractDllTypes
317
+ module.exports.extractDllFields = extractDllFields
318
+ module.exports.extractCsharpTypes = extractCsharpTypes
319
+ module.exports.buildTypeRegistry = buildTypeRegistry
320
+ module.exports.extractSerializedFields = extractSerializedFields
316
321
  module.exports.Scanner = Scanner
317
322
  module.exports.Indexer = Indexer
318
323
  module.exports.EmbeddingGenerator = EmbeddingGenerator
319
324
  module.exports.walkProjectFiles = walkProjectFiles
320
325
  module.exports.grepProject = grepProject
321
326
  module.exports.buildGuidCache = buildGuidCache
327
+ module.exports.buildPackageGuidCache = buildPackageGuidCache
322
328
  module.exports.getVersion = getVersion
323
329
  module.exports.isNativeAvailable = isNativeAvailable
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unity-agentic-tools",
3
3
  "packageManager": "bun@latest",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "description": "Fast, token-efficient Unity YAML parser for AI agents",
6
6
  "exports": {
7
7
  ".": {