unity-agentic-tools 0.1.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/LICENSE +190 -0
- package/README.md +36 -0
- package/dist/cli.js +8848 -0
- package/dist/doc-indexer-cli.js +3016 -0
- package/dist/index.js +2719 -0
- package/native/index.d.ts +230 -0
- package/native/index.js +323 -0
- package/native/unity-file-tools.darwin-arm64.node +0 -0
- package/native/unity-file-tools.darwin-x64.node +0 -0
- package/native/unity-file-tools.linux-x64-gnu.node +0 -0
- package/native/unity-file-tools.win32-x64-msvc.node +0 -0
- package/package.json +65 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
/** Basic GameObject information */
|
|
7
|
+
export interface GameObject {
|
|
8
|
+
name: string
|
|
9
|
+
fileId: string
|
|
10
|
+
active: boolean
|
|
11
|
+
matchScore?: number | undefined
|
|
12
|
+
}
|
|
13
|
+
/** Component information */
|
|
14
|
+
export interface Component {
|
|
15
|
+
type: string
|
|
16
|
+
classId: number
|
|
17
|
+
fileId: string
|
|
18
|
+
scriptPath?: string | undefined
|
|
19
|
+
scriptGuid?: string | undefined
|
|
20
|
+
scriptName?: string | undefined
|
|
21
|
+
properties?: Record<string, any> | undefined
|
|
22
|
+
}
|
|
23
|
+
/** GameObject with detailed component information */
|
|
24
|
+
export interface GameObjectDetail {
|
|
25
|
+
name: string
|
|
26
|
+
fileId: string
|
|
27
|
+
active: boolean
|
|
28
|
+
tag: string
|
|
29
|
+
layer: number
|
|
30
|
+
depth?: number | undefined
|
|
31
|
+
components: Array<Component>
|
|
32
|
+
children?: string[] | undefined
|
|
33
|
+
parentTransformId?: string | undefined
|
|
34
|
+
}
|
|
35
|
+
/** PrefabInstance information */
|
|
36
|
+
export interface PrefabInstanceInfo {
|
|
37
|
+
name: string
|
|
38
|
+
fileId: string
|
|
39
|
+
sourceGuid: string
|
|
40
|
+
sourcePrefab?: string | undefined
|
|
41
|
+
modificationsCount: number
|
|
42
|
+
}
|
|
43
|
+
/** A single property override in a PrefabInstance */
|
|
44
|
+
export interface PrefabModification {
|
|
45
|
+
targetFileId: string
|
|
46
|
+
targetGuid?: string | undefined
|
|
47
|
+
propertyPath: string
|
|
48
|
+
value: string
|
|
49
|
+
}
|
|
50
|
+
/** Union result from find_by_name: either a GameObject or PrefabInstance */
|
|
51
|
+
export interface FindResult {
|
|
52
|
+
name: string
|
|
53
|
+
fileId: string
|
|
54
|
+
resultType: string
|
|
55
|
+
active?: boolean | undefined
|
|
56
|
+
matchScore?: number | undefined
|
|
57
|
+
sourceGuid?: string | undefined
|
|
58
|
+
sourcePrefab?: string | undefined
|
|
59
|
+
modificationsCount?: number | undefined
|
|
60
|
+
}
|
|
61
|
+
/** Full scene inspection result */
|
|
62
|
+
export interface SceneInspection {
|
|
63
|
+
file: string
|
|
64
|
+
count: number
|
|
65
|
+
gameobjects: Array<GameObjectDetail>
|
|
66
|
+
prefabInstances?: PrefabInstanceInfo[] | undefined
|
|
67
|
+
}
|
|
68
|
+
/** Options for scanning */
|
|
69
|
+
export interface ScanOptions {
|
|
70
|
+
verbose?: boolean | undefined
|
|
71
|
+
}
|
|
72
|
+
/** Options for inspecting */
|
|
73
|
+
export interface InspectOptions {
|
|
74
|
+
file: string
|
|
75
|
+
identifier?: string | undefined
|
|
76
|
+
includeProperties?: boolean | undefined
|
|
77
|
+
verbose?: boolean | undefined
|
|
78
|
+
}
|
|
79
|
+
/** Pagination options for inspect_all */
|
|
80
|
+
export interface PaginationOptions {
|
|
81
|
+
file: string
|
|
82
|
+
includeProperties?: boolean | undefined
|
|
83
|
+
verbose?: boolean | undefined
|
|
84
|
+
pageSize?: number | undefined
|
|
85
|
+
cursor?: number | undefined
|
|
86
|
+
maxDepth?: number | undefined
|
|
87
|
+
filterComponent?: string | undefined
|
|
88
|
+
}
|
|
89
|
+
/** Paginated inspection result */
|
|
90
|
+
export interface PaginatedInspection {
|
|
91
|
+
file: string
|
|
92
|
+
total: number
|
|
93
|
+
cursor: number
|
|
94
|
+
nextCursor?: number | undefined
|
|
95
|
+
truncated: boolean
|
|
96
|
+
pageSize: number
|
|
97
|
+
gameobjects: Array<GameObjectDetail>
|
|
98
|
+
prefabInstances?: PrefabInstanceInfo[] | undefined
|
|
99
|
+
error?: string | undefined
|
|
100
|
+
}
|
|
101
|
+
/** Chunk types for indexing */
|
|
102
|
+
export const enum ChunkType {
|
|
103
|
+
Prose = 'Prose',
|
|
104
|
+
Code = 'Code',
|
|
105
|
+
Api = 'Api',
|
|
106
|
+
Example = 'Example'
|
|
107
|
+
}
|
|
108
|
+
/** Chunk metadata */
|
|
109
|
+
export interface ChunkMetadata {
|
|
110
|
+
filePath: string
|
|
111
|
+
section?: string | undefined
|
|
112
|
+
language?: string | undefined
|
|
113
|
+
unityClass?: string | undefined
|
|
114
|
+
unityMethod?: string | undefined
|
|
115
|
+
}
|
|
116
|
+
/** A chunk of indexed content */
|
|
117
|
+
export interface Chunk {
|
|
118
|
+
id: string
|
|
119
|
+
content: string
|
|
120
|
+
tokens: number
|
|
121
|
+
type: ChunkType
|
|
122
|
+
metadata: ChunkMetadata
|
|
123
|
+
}
|
|
124
|
+
/** Result of indexing operation */
|
|
125
|
+
export interface IndexResult {
|
|
126
|
+
chunksIndexed: number
|
|
127
|
+
totalTokens: number
|
|
128
|
+
filesProcessed: number
|
|
129
|
+
elapsedMs: number
|
|
130
|
+
}
|
|
131
|
+
/** Search result from index */
|
|
132
|
+
export interface SearchResult {
|
|
133
|
+
id: string
|
|
134
|
+
content: string
|
|
135
|
+
score: number
|
|
136
|
+
metadata: ChunkMetadata
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Walk a Unity project and collect files matching the given extensions.
|
|
140
|
+
*
|
|
141
|
+
* Walks `Assets/` (and `ProjectSettings/` when `.asset` is among extensions).
|
|
142
|
+
* Skips standard Unity noise directories (Library, Temp, etc.).
|
|
143
|
+
*/
|
|
144
|
+
export declare function walkProjectFiles(projectPath: string, extensions: Array<string>, excludeDirs?: Array<string> | undefined | null): Array<string>
|
|
145
|
+
export interface NapiGrepOptions {
|
|
146
|
+
projectPath: string
|
|
147
|
+
pattern: string
|
|
148
|
+
fileType?: string
|
|
149
|
+
maxResults?: number
|
|
150
|
+
contextLines?: number
|
|
151
|
+
}
|
|
152
|
+
export interface NapiGrepMatch {
|
|
153
|
+
file: string
|
|
154
|
+
lineNumber: number
|
|
155
|
+
line: string
|
|
156
|
+
contextBefore?: Array<string>
|
|
157
|
+
contextAfter?: Array<string>
|
|
158
|
+
}
|
|
159
|
+
export interface NapiGrepResult {
|
|
160
|
+
success: boolean
|
|
161
|
+
projectPath: string
|
|
162
|
+
pattern: string
|
|
163
|
+
totalFilesScanned: number
|
|
164
|
+
totalMatches: number
|
|
165
|
+
truncated: boolean
|
|
166
|
+
matches: Array<NapiGrepMatch>
|
|
167
|
+
error?: string
|
|
168
|
+
}
|
|
169
|
+
/** Grep across Unity project files in parallel using Rayon. */
|
|
170
|
+
export declare function grepProject(options: NapiGrepOptions): NapiGrepResult
|
|
171
|
+
/**
|
|
172
|
+
* Build the GUID cache by scanning all .meta files under Assets/ in parallel.
|
|
173
|
+
*
|
|
174
|
+
* Returns a JSON object mapping `{ guid: relative_asset_path }`.
|
|
175
|
+
*/
|
|
176
|
+
export declare function buildGuidCache(projectRoot: string): any
|
|
177
|
+
/** Get the version of the native module */
|
|
178
|
+
export declare function getVersion(): string
|
|
179
|
+
/** Check if the native module is available */
|
|
180
|
+
export declare function isNativeAvailable(): boolean
|
|
181
|
+
/** High-performance Unity scene/prefab scanner */
|
|
182
|
+
export declare class Scanner {
|
|
183
|
+
constructor()
|
|
184
|
+
/** Add a hierarchy provider class ID (Transform-like components). */
|
|
185
|
+
addHierarchyProvider(classId: number): void
|
|
186
|
+
/** Add a script container class ID (MonoBehaviour-like components). */
|
|
187
|
+
addScriptContainer(classId: number): void
|
|
188
|
+
/** Set project root for GUID resolution */
|
|
189
|
+
setProjectRoot(path: string): void
|
|
190
|
+
/** Scan scene for basic GameObject information */
|
|
191
|
+
scanSceneMinimal(file: string): Array<GameObject>
|
|
192
|
+
/** Scan scene with component information */
|
|
193
|
+
scanSceneWithComponents(file: string, options?: ScanOptions | undefined | null): Array<any>
|
|
194
|
+
/** Find GameObjects and PrefabInstances by name pattern */
|
|
195
|
+
findByName(file: string, pattern: string, fuzzy: boolean): Array<FindResult>
|
|
196
|
+
/** Inspect a specific GameObject */
|
|
197
|
+
inspect(options: InspectOptions): any | null
|
|
198
|
+
/** Inspect entire file */
|
|
199
|
+
inspectAll(file: string, includeProperties: boolean, verbose: boolean): SceneInspection
|
|
200
|
+
/** Inspect entire file with pagination support */
|
|
201
|
+
inspectAllPaginated(options: PaginationOptions): PaginatedInspection
|
|
202
|
+
/** Read a .asset file and return its root objects with properties */
|
|
203
|
+
readAsset(file: string): any
|
|
204
|
+
}
|
|
205
|
+
/** High-performance documentation indexer */
|
|
206
|
+
export declare class Indexer {
|
|
207
|
+
constructor()
|
|
208
|
+
/** Index a single file */
|
|
209
|
+
indexFile(path: string): IndexResult
|
|
210
|
+
/** Index a directory of files */
|
|
211
|
+
indexDirectory(path: string): IndexResult
|
|
212
|
+
/** Search the index */
|
|
213
|
+
search(query: string): Array<SearchResult>
|
|
214
|
+
/** Clear the index */
|
|
215
|
+
clear(): void
|
|
216
|
+
/** Get index statistics */
|
|
217
|
+
stats(): any
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Local CPU embedding generator using all-MiniLM-L6-v2 (384 dims).
|
|
221
|
+
* Wraps fastembed-rs / ONNX Runtime. Model auto-downloads on first use
|
|
222
|
+
* and is cached at ~/.claude/unity-agentic-tools/models/.
|
|
223
|
+
*/
|
|
224
|
+
export declare class EmbeddingGenerator {
|
|
225
|
+
constructor()
|
|
226
|
+
/** Generate embedding for a single text. Returns a Vec<f64> (384 dims). */
|
|
227
|
+
generate(text: string): Array<number>
|
|
228
|
+
/** Generate embeddings for a batch of texts. Returns Vec<Vec<f64>>. */
|
|
229
|
+
generateBatch(texts: Array<string>): Array<Array<number>>
|
|
230
|
+
}
|
package/native/index.js
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* prettier-ignore */
|
|
4
|
+
|
|
5
|
+
/* auto-generated by NAPI-RS */
|
|
6
|
+
|
|
7
|
+
const { existsSync, readFileSync } = require('fs')
|
|
8
|
+
const { join } = require('path')
|
|
9
|
+
|
|
10
|
+
const { platform, arch } = process
|
|
11
|
+
|
|
12
|
+
let nativeBinding = null
|
|
13
|
+
let localFileExisted = false
|
|
14
|
+
let loadError = null
|
|
15
|
+
|
|
16
|
+
function isMusl() {
|
|
17
|
+
// For Node 10
|
|
18
|
+
if (!process.report || typeof process.report.getReport !== 'function') {
|
|
19
|
+
try {
|
|
20
|
+
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
|
21
|
+
return readFileSync(lddPath, 'utf8').includes('musl')
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
const { glibcVersionRuntime } = process.report.getReport().header
|
|
27
|
+
return !glibcVersionRuntime
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
switch (platform) {
|
|
32
|
+
case 'android':
|
|
33
|
+
switch (arch) {
|
|
34
|
+
case 'arm64':
|
|
35
|
+
localFileExisted = existsSync(join(__dirname, 'unity-file-tools.android-arm64.node'))
|
|
36
|
+
try {
|
|
37
|
+
if (localFileExisted) {
|
|
38
|
+
nativeBinding = require('./unity-file-tools.android-arm64.node')
|
|
39
|
+
} else {
|
|
40
|
+
nativeBinding = require('unity-file-tools-android-arm64')
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {
|
|
43
|
+
loadError = e
|
|
44
|
+
}
|
|
45
|
+
break
|
|
46
|
+
case 'arm':
|
|
47
|
+
localFileExisted = existsSync(join(__dirname, 'unity-file-tools.android-arm-eabi.node'))
|
|
48
|
+
try {
|
|
49
|
+
if (localFileExisted) {
|
|
50
|
+
nativeBinding = require('./unity-file-tools.android-arm-eabi.node')
|
|
51
|
+
} else {
|
|
52
|
+
nativeBinding = require('unity-file-tools-android-arm-eabi')
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
loadError = e
|
|
56
|
+
}
|
|
57
|
+
break
|
|
58
|
+
default:
|
|
59
|
+
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
60
|
+
}
|
|
61
|
+
break
|
|
62
|
+
case 'win32':
|
|
63
|
+
switch (arch) {
|
|
64
|
+
case 'x64':
|
|
65
|
+
localFileExisted = existsSync(
|
|
66
|
+
join(__dirname, 'unity-file-tools.win32-x64-msvc.node')
|
|
67
|
+
)
|
|
68
|
+
try {
|
|
69
|
+
if (localFileExisted) {
|
|
70
|
+
nativeBinding = require('./unity-file-tools.win32-x64-msvc.node')
|
|
71
|
+
} else {
|
|
72
|
+
nativeBinding = require('unity-file-tools-win32-x64-msvc')
|
|
73
|
+
}
|
|
74
|
+
} catch (e) {
|
|
75
|
+
loadError = e
|
|
76
|
+
}
|
|
77
|
+
break
|
|
78
|
+
case 'ia32':
|
|
79
|
+
localFileExisted = existsSync(
|
|
80
|
+
join(__dirname, 'unity-file-tools.win32-ia32-msvc.node')
|
|
81
|
+
)
|
|
82
|
+
try {
|
|
83
|
+
if (localFileExisted) {
|
|
84
|
+
nativeBinding = require('./unity-file-tools.win32-ia32-msvc.node')
|
|
85
|
+
} else {
|
|
86
|
+
nativeBinding = require('unity-file-tools-win32-ia32-msvc')
|
|
87
|
+
}
|
|
88
|
+
} catch (e) {
|
|
89
|
+
loadError = e
|
|
90
|
+
}
|
|
91
|
+
break
|
|
92
|
+
case 'arm64':
|
|
93
|
+
localFileExisted = existsSync(
|
|
94
|
+
join(__dirname, 'unity-file-tools.win32-arm64-msvc.node')
|
|
95
|
+
)
|
|
96
|
+
try {
|
|
97
|
+
if (localFileExisted) {
|
|
98
|
+
nativeBinding = require('./unity-file-tools.win32-arm64-msvc.node')
|
|
99
|
+
} else {
|
|
100
|
+
nativeBinding = require('unity-file-tools-win32-arm64-msvc')
|
|
101
|
+
}
|
|
102
|
+
} catch (e) {
|
|
103
|
+
loadError = e
|
|
104
|
+
}
|
|
105
|
+
break
|
|
106
|
+
default:
|
|
107
|
+
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
108
|
+
}
|
|
109
|
+
break
|
|
110
|
+
case 'darwin':
|
|
111
|
+
localFileExisted = existsSync(join(__dirname, 'unity-file-tools.darwin-universal.node'))
|
|
112
|
+
try {
|
|
113
|
+
if (localFileExisted) {
|
|
114
|
+
nativeBinding = require('./unity-file-tools.darwin-universal.node')
|
|
115
|
+
} else {
|
|
116
|
+
nativeBinding = require('unity-file-tools-darwin-universal')
|
|
117
|
+
}
|
|
118
|
+
break
|
|
119
|
+
} catch {}
|
|
120
|
+
switch (arch) {
|
|
121
|
+
case 'x64':
|
|
122
|
+
localFileExisted = existsSync(join(__dirname, 'unity-file-tools.darwin-x64.node'))
|
|
123
|
+
try {
|
|
124
|
+
if (localFileExisted) {
|
|
125
|
+
nativeBinding = require('./unity-file-tools.darwin-x64.node')
|
|
126
|
+
} else {
|
|
127
|
+
nativeBinding = require('unity-file-tools-darwin-x64')
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
loadError = e
|
|
131
|
+
}
|
|
132
|
+
break
|
|
133
|
+
case 'arm64':
|
|
134
|
+
localFileExisted = existsSync(
|
|
135
|
+
join(__dirname, 'unity-file-tools.darwin-arm64.node')
|
|
136
|
+
)
|
|
137
|
+
try {
|
|
138
|
+
if (localFileExisted) {
|
|
139
|
+
nativeBinding = require('./unity-file-tools.darwin-arm64.node')
|
|
140
|
+
} else {
|
|
141
|
+
nativeBinding = require('unity-file-tools-darwin-arm64')
|
|
142
|
+
}
|
|
143
|
+
} catch (e) {
|
|
144
|
+
loadError = e
|
|
145
|
+
}
|
|
146
|
+
break
|
|
147
|
+
default:
|
|
148
|
+
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
|
149
|
+
}
|
|
150
|
+
break
|
|
151
|
+
case 'freebsd':
|
|
152
|
+
if (arch !== 'x64') {
|
|
153
|
+
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
|
154
|
+
}
|
|
155
|
+
localFileExisted = existsSync(join(__dirname, 'unity-file-tools.freebsd-x64.node'))
|
|
156
|
+
try {
|
|
157
|
+
if (localFileExisted) {
|
|
158
|
+
nativeBinding = require('./unity-file-tools.freebsd-x64.node')
|
|
159
|
+
} else {
|
|
160
|
+
nativeBinding = require('unity-file-tools-freebsd-x64')
|
|
161
|
+
}
|
|
162
|
+
} catch (e) {
|
|
163
|
+
loadError = e
|
|
164
|
+
}
|
|
165
|
+
break
|
|
166
|
+
case 'linux':
|
|
167
|
+
switch (arch) {
|
|
168
|
+
case 'x64':
|
|
169
|
+
if (isMusl()) {
|
|
170
|
+
localFileExisted = existsSync(
|
|
171
|
+
join(__dirname, 'unity-file-tools.linux-x64-musl.node')
|
|
172
|
+
)
|
|
173
|
+
try {
|
|
174
|
+
if (localFileExisted) {
|
|
175
|
+
nativeBinding = require('./unity-file-tools.linux-x64-musl.node')
|
|
176
|
+
} else {
|
|
177
|
+
nativeBinding = require('unity-file-tools-linux-x64-musl')
|
|
178
|
+
}
|
|
179
|
+
} catch (e) {
|
|
180
|
+
loadError = e
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
localFileExisted = existsSync(
|
|
184
|
+
join(__dirname, 'unity-file-tools.linux-x64-gnu.node')
|
|
185
|
+
)
|
|
186
|
+
try {
|
|
187
|
+
if (localFileExisted) {
|
|
188
|
+
nativeBinding = require('./unity-file-tools.linux-x64-gnu.node')
|
|
189
|
+
} else {
|
|
190
|
+
nativeBinding = require('unity-file-tools-linux-x64-gnu')
|
|
191
|
+
}
|
|
192
|
+
} catch (e) {
|
|
193
|
+
loadError = e
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
break
|
|
197
|
+
case 'arm64':
|
|
198
|
+
if (isMusl()) {
|
|
199
|
+
localFileExisted = existsSync(
|
|
200
|
+
join(__dirname, 'unity-file-tools.linux-arm64-musl.node')
|
|
201
|
+
)
|
|
202
|
+
try {
|
|
203
|
+
if (localFileExisted) {
|
|
204
|
+
nativeBinding = require('./unity-file-tools.linux-arm64-musl.node')
|
|
205
|
+
} else {
|
|
206
|
+
nativeBinding = require('unity-file-tools-linux-arm64-musl')
|
|
207
|
+
}
|
|
208
|
+
} catch (e) {
|
|
209
|
+
loadError = e
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
localFileExisted = existsSync(
|
|
213
|
+
join(__dirname, 'unity-file-tools.linux-arm64-gnu.node')
|
|
214
|
+
)
|
|
215
|
+
try {
|
|
216
|
+
if (localFileExisted) {
|
|
217
|
+
nativeBinding = require('./unity-file-tools.linux-arm64-gnu.node')
|
|
218
|
+
} else {
|
|
219
|
+
nativeBinding = require('unity-file-tools-linux-arm64-gnu')
|
|
220
|
+
}
|
|
221
|
+
} catch (e) {
|
|
222
|
+
loadError = e
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
break
|
|
226
|
+
case 'arm':
|
|
227
|
+
if (isMusl()) {
|
|
228
|
+
localFileExisted = existsSync(
|
|
229
|
+
join(__dirname, 'unity-file-tools.linux-arm-musleabihf.node')
|
|
230
|
+
)
|
|
231
|
+
try {
|
|
232
|
+
if (localFileExisted) {
|
|
233
|
+
nativeBinding = require('./unity-file-tools.linux-arm-musleabihf.node')
|
|
234
|
+
} else {
|
|
235
|
+
nativeBinding = require('unity-file-tools-linux-arm-musleabihf')
|
|
236
|
+
}
|
|
237
|
+
} catch (e) {
|
|
238
|
+
loadError = e
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
localFileExisted = existsSync(
|
|
242
|
+
join(__dirname, 'unity-file-tools.linux-arm-gnueabihf.node')
|
|
243
|
+
)
|
|
244
|
+
try {
|
|
245
|
+
if (localFileExisted) {
|
|
246
|
+
nativeBinding = require('./unity-file-tools.linux-arm-gnueabihf.node')
|
|
247
|
+
} else {
|
|
248
|
+
nativeBinding = require('unity-file-tools-linux-arm-gnueabihf')
|
|
249
|
+
}
|
|
250
|
+
} catch (e) {
|
|
251
|
+
loadError = e
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
break
|
|
255
|
+
case 'riscv64':
|
|
256
|
+
if (isMusl()) {
|
|
257
|
+
localFileExisted = existsSync(
|
|
258
|
+
join(__dirname, 'unity-file-tools.linux-riscv64-musl.node')
|
|
259
|
+
)
|
|
260
|
+
try {
|
|
261
|
+
if (localFileExisted) {
|
|
262
|
+
nativeBinding = require('./unity-file-tools.linux-riscv64-musl.node')
|
|
263
|
+
} else {
|
|
264
|
+
nativeBinding = require('unity-file-tools-linux-riscv64-musl')
|
|
265
|
+
}
|
|
266
|
+
} catch (e) {
|
|
267
|
+
loadError = e
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
localFileExisted = existsSync(
|
|
271
|
+
join(__dirname, 'unity-file-tools.linux-riscv64-gnu.node')
|
|
272
|
+
)
|
|
273
|
+
try {
|
|
274
|
+
if (localFileExisted) {
|
|
275
|
+
nativeBinding = require('./unity-file-tools.linux-riscv64-gnu.node')
|
|
276
|
+
} else {
|
|
277
|
+
nativeBinding = require('unity-file-tools-linux-riscv64-gnu')
|
|
278
|
+
}
|
|
279
|
+
} catch (e) {
|
|
280
|
+
loadError = e
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
break
|
|
284
|
+
case 's390x':
|
|
285
|
+
localFileExisted = existsSync(
|
|
286
|
+
join(__dirname, 'unity-file-tools.linux-s390x-gnu.node')
|
|
287
|
+
)
|
|
288
|
+
try {
|
|
289
|
+
if (localFileExisted) {
|
|
290
|
+
nativeBinding = require('./unity-file-tools.linux-s390x-gnu.node')
|
|
291
|
+
} else {
|
|
292
|
+
nativeBinding = require('unity-file-tools-linux-s390x-gnu')
|
|
293
|
+
}
|
|
294
|
+
} catch (e) {
|
|
295
|
+
loadError = e
|
|
296
|
+
}
|
|
297
|
+
break
|
|
298
|
+
default:
|
|
299
|
+
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
300
|
+
}
|
|
301
|
+
break
|
|
302
|
+
default:
|
|
303
|
+
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (!nativeBinding) {
|
|
307
|
+
if (loadError) {
|
|
308
|
+
throw loadError
|
|
309
|
+
}
|
|
310
|
+
throw new Error(`Failed to load native binding`)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const { ChunkType, Scanner, Indexer, EmbeddingGenerator, walkProjectFiles, grepProject, buildGuidCache, getVersion, isNativeAvailable } = nativeBinding
|
|
314
|
+
|
|
315
|
+
module.exports.ChunkType = ChunkType
|
|
316
|
+
module.exports.Scanner = Scanner
|
|
317
|
+
module.exports.Indexer = Indexer
|
|
318
|
+
module.exports.EmbeddingGenerator = EmbeddingGenerator
|
|
319
|
+
module.exports.walkProjectFiles = walkProjectFiles
|
|
320
|
+
module.exports.grepProject = grepProject
|
|
321
|
+
module.exports.buildGuidCache = buildGuidCache
|
|
322
|
+
module.exports.getVersion = getVersion
|
|
323
|
+
module.exports.isNativeAvailable = isNativeAvailable
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "unity-agentic-tools",
|
|
3
|
+
"packageManager": "bun@latest",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Fast, token-efficient Unity YAML parser for AI agents",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"./cli": "./dist/cli.js",
|
|
12
|
+
"./scanner": "./dist/scanner.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"native",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "bun run build:lib && bun run build:cli && rm -f dist/*.node && cp ../doc-indexer/dist/cli.js dist/doc-indexer-cli.js",
|
|
22
|
+
"build:lib": "bun build src/index.ts --outdir=dist --target=bun --format=cjs --external unity-file-tools",
|
|
23
|
+
"build:cli": "bun build src/cli.ts --outdir=dist --target=bun --format=cjs --external unity-file-tools",
|
|
24
|
+
"build:rust": "cd ../rust-core && bun run build",
|
|
25
|
+
"build:all": "bun run build:rust || echo 'Rust build skipped' && bun run build",
|
|
26
|
+
"dev": "bun build src/index.ts --watch",
|
|
27
|
+
"clean": "rm -rf dist",
|
|
28
|
+
"rebuild": "bun run clean && bun run build",
|
|
29
|
+
"test": "bun test",
|
|
30
|
+
"test:watch": "bun test --watch",
|
|
31
|
+
"test:coverage": "bun test --coverage"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"commander": "^14.0.2"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^25.0.0",
|
|
38
|
+
"@vitest/ui": "^4.0.16",
|
|
39
|
+
"typescript": "^5.3.0",
|
|
40
|
+
"unity-file-tools": "workspace:*",
|
|
41
|
+
"vitest": "^4.0.16"
|
|
42
|
+
},
|
|
43
|
+
"type": "commonjs",
|
|
44
|
+
"bin": {
|
|
45
|
+
"unity-agentic-tools": "./dist/cli.js"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"bun": ">=1.0.0"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/taconotsandwich/unity-agentic-tools"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"unity",
|
|
56
|
+
"yaml",
|
|
57
|
+
"parser",
|
|
58
|
+
"scene",
|
|
59
|
+
"prefab",
|
|
60
|
+
"gameobject",
|
|
61
|
+
"ai",
|
|
62
|
+
"cli"
|
|
63
|
+
],
|
|
64
|
+
"license": "Apache-2.0"
|
|
65
|
+
}
|