unity-open-mcp 0.5.0 → 0.7.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/README.md +24 -73
- package/dist/batch-spawn.d.ts +4 -0
- package/dist/batch-spawn.js +73 -18
- package/dist/batch-spawn.js.map +1 -1
- package/dist/capabilities/build-capabilities.d.ts +5 -5
- package/dist/capabilities/build-capabilities.js +2 -2
- package/dist/capabilities/cost-hints.js +20 -0
- package/dist/capabilities/cost-hints.js.map +1 -1
- package/dist/capabilities/lifecycle.js +1 -1
- package/dist/capabilities/lifecycle.js.map +1 -1
- package/dist/capabilities/tool-groups.d.ts +6 -9
- package/dist/capabilities/tool-groups.js +11 -13
- package/dist/capabilities/tool-groups.js.map +1 -1
- package/dist/cli/commands.js +9 -8
- package/dist/cli/commands.js.map +1 -1
- package/dist/compressible-router.js +6 -0
- package/dist/compressible-router.js.map +1 -1
- package/dist/constants.d.ts +89 -0
- package/dist/constants.js +109 -0
- package/dist/constants.js.map +1 -0
- package/dist/dialog-dismiss.d.ts +0 -7
- package/dist/dialog-dismiss.js +17 -19
- package/dist/dialog-dismiss.js.map +1 -1
- package/dist/hub-control.d.ts +6 -2
- package/dist/hub-control.js +8 -8
- package/dist/hub-control.js.map +1 -1
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/dist/instance-discovery.js +2 -1
- package/dist/instance-discovery.js.map +1 -1
- package/dist/live-client.d.ts +49 -0
- package/dist/live-client.js +292 -255
- package/dist/live-client.js.map +1 -1
- package/dist/offline/api.d.ts +171 -0
- package/dist/offline/api.js +855 -0
- package/dist/offline/api.js.map +1 -0
- package/dist/offline/hierarchy.d.ts +24 -0
- package/dist/offline/hierarchy.js +242 -0
- package/dist/offline/hierarchy.js.map +1 -0
- package/dist/offline/index-builders.d.ts +11 -0
- package/dist/offline/index-builders.js +202 -0
- package/dist/offline/index-builders.js.map +1 -0
- package/dist/offline/model.d.ts +8 -0
- package/dist/offline/model.js +188 -0
- package/dist/offline/model.js.map +1 -0
- package/dist/offline/names.d.ts +7 -0
- package/dist/offline/names.js +20 -0
- package/dist/offline/names.js.map +1 -0
- package/dist/offline/overrides.d.ts +17 -0
- package/dist/offline/overrides.js +266 -0
- package/dist/offline/overrides.js.map +1 -0
- package/dist/offline/parse.d.ts +25 -0
- package/dist/offline/parse.js +236 -0
- package/dist/offline/parse.js.map +1 -0
- package/dist/offline/paths.d.ts +4 -0
- package/dist/offline/paths.js +23 -0
- package/dist/offline/paths.js.map +1 -0
- package/dist/offline/primitives.d.ts +17 -0
- package/dist/offline/primitives.js +195 -0
- package/dist/offline/primitives.js.map +1 -0
- package/dist/offline/references.d.ts +9 -0
- package/dist/offline/references.js +55 -0
- package/dist/offline/references.js.map +1 -0
- package/dist/offline/types.d.ts +65 -0
- package/dist/offline/types.js +154 -0
- package/dist/offline/types.js.map +1 -0
- package/dist/offline.d.ts +2 -180
- package/dist/offline.js +27 -2282
- package/dist/offline.js.map +1 -1
- package/dist/project-health.d.ts +1 -1
- package/dist/project-health.js +66 -3
- package/dist/project-health.js.map +1 -1
- package/dist/routers.js +6 -5
- package/dist/routers.js.map +1 -1
- package/dist/tool-router.d.ts +13 -0
- package/dist/tool-router.js +179 -251
- package/dist/tool-router.js.map +1 -1
- package/dist/tool-session-state.js +18 -9
- package/dist/tool-session-state.js.map +1 -1
- package/dist/tools/apply-fix.js +7 -2
- package/dist/tools/apply-fix.js.map +1 -1
- package/dist/tools/batch-execute.js +8 -2
- package/dist/tools/batch-execute.js.map +1 -1
- package/dist/tools/bridge-status.js +1 -2
- package/dist/tools/bridge-status.js.map +1 -1
- package/dist/tools/checkpoint-create.js +1 -0
- package/dist/tools/checkpoint-create.js.map +1 -1
- package/dist/tools/component-get.js +44 -11
- package/dist/tools/component-get.js.map +1 -1
- package/dist/tools/delta.js +1 -0
- package/dist/tools/delta.js.map +1 -1
- package/dist/tools/dependencies.js +4 -1
- package/dist/tools/dependencies.js.map +1 -1
- package/dist/tools/editor-status.js +3 -2
- package/dist/tools/editor-status.js.map +1 -1
- package/dist/tools/execute-csharp.js +3 -2
- package/dist/tools/execute-csharp.js.map +1 -1
- package/dist/tools/find-references.js +8 -1
- package/dist/tools/find-references.js.map +1 -1
- package/dist/tools/index.js +19 -17
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inputsystem-asset-create.js +4 -4
- package/dist/tools/inputsystem-asset-create.js.map +1 -1
- package/dist/tools/invoke-method.js +2 -1
- package/dist/tools/invoke-method.js.map +1 -1
- package/dist/tools/manage-tools.js +10 -10
- package/dist/tools/manage-tools.js.map +1 -1
- package/dist/tools/navigation-surface-add.js +6 -5
- package/dist/tools/navigation-surface-add.js.map +1 -1
- package/dist/tools/probuilder-create-shape.js +4 -4
- package/dist/tools/probuilder-create-shape.js.map +1 -1
- package/dist/tools/read-compile-errors.js +44 -31
- package/dist/tools/read-compile-errors.js.map +1 -1
- package/dist/tools/scene-get-data.js +10 -2
- package/dist/tools/scene-get-data.js.map +1 -1
- package/dist/tools/scene-save.js +16 -5
- package/dist/tools/scene-save.js.map +1 -1
- package/dist/tools/scene-set-active.js +22 -6
- package/dist/tools/scene-set-active.js.map +1 -1
- package/dist/tools/scene-unload.js +20 -6
- package/dist/tools/scene-unload.js.map +1 -1
- package/dist/tools/search-assets.js +3 -1
- package/dist/tools/search-assets.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Shared internal types and constants for the offline asset reader.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from the former monolithic offline.ts (M28-refactoring Plan 3,
|
|
4
|
+
// T3.1). These types and lookup tables are imported by every offline submodule
|
|
5
|
+
// — parse, hierarchy, overrides, references, primitives. Keeping them in one
|
|
6
|
+
// leaf module with no runtime imports of its own preserves the static,
|
|
7
|
+
// type-stripping-safe import graph.
|
|
8
|
+
import { extname } from "node:path";
|
|
9
|
+
// ===========================================================================
|
|
10
|
+
// Native Unity class IDs → names.
|
|
11
|
+
// ===========================================================================
|
|
12
|
+
export const nativeClassNames = {
|
|
13
|
+
1: "GameObject",
|
|
14
|
+
4: "Transform",
|
|
15
|
+
20: "Camera",
|
|
16
|
+
23: "MeshRenderer",
|
|
17
|
+
33: "MeshFilter",
|
|
18
|
+
64: "MeshCollider",
|
|
19
|
+
65: "BoxCollider",
|
|
20
|
+
81: "AudioListener",
|
|
21
|
+
82: "AudioSource",
|
|
22
|
+
95: "Animator",
|
|
23
|
+
108: "Light",
|
|
24
|
+
114: "MonoBehaviour",
|
|
25
|
+
115: "MonoScript",
|
|
26
|
+
120: "LineRenderer",
|
|
27
|
+
137: "SkinnedMeshRenderer",
|
|
28
|
+
156: "Terrain",
|
|
29
|
+
198: "ParticleSystem",
|
|
30
|
+
212: "SpriteRenderer",
|
|
31
|
+
222: "CanvasRenderer",
|
|
32
|
+
223: "Canvas",
|
|
33
|
+
224: "RectTransform",
|
|
34
|
+
225: "CanvasGroup",
|
|
35
|
+
329: "VideoPlayer",
|
|
36
|
+
73398921: "VFXRenderer",
|
|
37
|
+
};
|
|
38
|
+
export function nativeClassName(classID) {
|
|
39
|
+
return nativeClassNames[classID] ?? "";
|
|
40
|
+
}
|
|
41
|
+
// ===========================================================================
|
|
42
|
+
// Kind / extension utilities.
|
|
43
|
+
// ===========================================================================
|
|
44
|
+
export const extToKind = {
|
|
45
|
+
".anim": "anim",
|
|
46
|
+
".asmdef": "asmdef",
|
|
47
|
+
".asset": "asset",
|
|
48
|
+
".controller": "controller",
|
|
49
|
+
".cs": "cs",
|
|
50
|
+
".mat": "mat",
|
|
51
|
+
".overrideController": "controller",
|
|
52
|
+
".physicsMaterial2D": "physics2d",
|
|
53
|
+
".physicMaterial": "physics",
|
|
54
|
+
".playable": "playable",
|
|
55
|
+
".prefab": "prefab",
|
|
56
|
+
".preset": "preset",
|
|
57
|
+
".shader": "shader",
|
|
58
|
+
".shadergraph": "shadergraph",
|
|
59
|
+
".shadersubgraph": "shadergraph",
|
|
60
|
+
".spriteatlas": "atlas",
|
|
61
|
+
".terrainlayer": "terrainlayer",
|
|
62
|
+
".unity": "scene",
|
|
63
|
+
".uss": "uss",
|
|
64
|
+
".uxml": "uxml",
|
|
65
|
+
".vfx": "vfx",
|
|
66
|
+
".meta": "meta",
|
|
67
|
+
};
|
|
68
|
+
// ===========================================================================
|
|
69
|
+
// M24 — offline-parseable extension sets.
|
|
70
|
+
// YAML_PARSEABLE covers text-serialized Unity YAML; JSON_PARSEABLE covers the
|
|
71
|
+
// JSON asset kinds unity-scanner does not handle (our differentiator). Both are
|
|
72
|
+
// merged into OFFLINE_PARSEABLE for the read_asset / search / find_references
|
|
73
|
+
// gates. LISTABLE stays broader (it never parses, only enumerates files).
|
|
74
|
+
// ===========================================================================
|
|
75
|
+
export const YAML_PARSEABLE_EXTENSIONS = new Set([
|
|
76
|
+
".prefab", ".unity", ".asset", ".mat", ".controller", ".anim", ".playable",
|
|
77
|
+
".preset", ".spriteatlas", ".terrainlayer", ".vfx",
|
|
78
|
+
]);
|
|
79
|
+
export const JSON_PARSEABLE_EXTENSIONS = new Set([
|
|
80
|
+
".asmdef", ".shadergraph", ".shadersubgraph",
|
|
81
|
+
]);
|
|
82
|
+
export const OFFLINE_PARSEABLE_EXTENSIONS = new Set([
|
|
83
|
+
...YAML_PARSEABLE_EXTENSIONS,
|
|
84
|
+
...JSON_PARSEABLE_EXTENSIONS,
|
|
85
|
+
]);
|
|
86
|
+
export function offlineParseKind(assetPath) {
|
|
87
|
+
const dot = assetPath.lastIndexOf(".");
|
|
88
|
+
if (dot < 0)
|
|
89
|
+
return null;
|
|
90
|
+
const ext = assetPath.slice(dot).toLowerCase();
|
|
91
|
+
if (YAML_PARSEABLE_EXTENSIONS.has(ext))
|
|
92
|
+
return "yaml";
|
|
93
|
+
if (JSON_PARSEABLE_EXTENSIONS.has(ext))
|
|
94
|
+
return "json";
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
export const kindAliases = {
|
|
98
|
+
prefabs: "prefab",
|
|
99
|
+
scenes: "scene",
|
|
100
|
+
unity: "scene",
|
|
101
|
+
scripts: "cs",
|
|
102
|
+
script: "cs",
|
|
103
|
+
material: "mat",
|
|
104
|
+
materials: "mat",
|
|
105
|
+
};
|
|
106
|
+
export function kindForPath(path) {
|
|
107
|
+
const ext = extname(path);
|
|
108
|
+
if (extToKind[ext])
|
|
109
|
+
return extToKind[ext];
|
|
110
|
+
if (ext === "")
|
|
111
|
+
return "none";
|
|
112
|
+
return ext.slice(1).toLowerCase();
|
|
113
|
+
}
|
|
114
|
+
export function normalizeKind(kind) {
|
|
115
|
+
const trimmed = kind.trim().toLowerCase();
|
|
116
|
+
if (kindAliases[trimmed])
|
|
117
|
+
return kindAliases[trimmed];
|
|
118
|
+
return trimmed;
|
|
119
|
+
}
|
|
120
|
+
export function parseKindSet(raw) {
|
|
121
|
+
const out = new Set();
|
|
122
|
+
for (const part of raw.split(",")) {
|
|
123
|
+
const kind = normalizeKind(part);
|
|
124
|
+
if (kind !== "")
|
|
125
|
+
out.add(kind);
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
export const skipDirs = new Set([
|
|
130
|
+
".git", ".vs", "Library", "Logs", "obj", "Obj",
|
|
131
|
+
"Temp", "Build", "Builds", "UserSettings", "node_modules",
|
|
132
|
+
]);
|
|
133
|
+
export function shouldSkipDir(name) {
|
|
134
|
+
return skipDirs.has(name);
|
|
135
|
+
}
|
|
136
|
+
// ===========================================================================
|
|
137
|
+
// Field extraction allow-list (shared by YAML + prefab-override renderers).
|
|
138
|
+
// ===========================================================================
|
|
139
|
+
export const skipFieldNames = new Set([
|
|
140
|
+
"m_Name", "m_ObjectHideFlags", "m_CorrespondingSourceObject",
|
|
141
|
+
"m_PrefabInstance", "m_PrefabAsset", "serializedVersion",
|
|
142
|
+
"m_GameObject", "m_Script", "m_Enabled",
|
|
143
|
+
"m_EditorHideFlags", "m_EditorClassIdentifier", "m_Modification",
|
|
144
|
+
]);
|
|
145
|
+
// A ParsedAsset stand-in used only by resolveReferences' local-reference path.
|
|
146
|
+
// JSON assets have no in-file fileIDs, so local ref resolution is a no-op.
|
|
147
|
+
export const EMPTY_PARSED = {
|
|
148
|
+
path: "",
|
|
149
|
+
kind: "",
|
|
150
|
+
guid: "",
|
|
151
|
+
objects: [],
|
|
152
|
+
byID: new Map(),
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/offline/types.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,6EAA6E;AAC7E,uEAAuE;AACvE,oCAAoC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqEpC,8EAA8E;AAC9E,kCAAkC;AAClC,8EAA8E;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,WAAW;IACd,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,UAAU;IACd,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,aAAa;IAClB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,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model: AssetModel;
|
|
5
|
-
source: "offline";
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* M24 — full-hierarchy parity helper. The offline `objectCount` counts every
|
|
9
|
-
* YAML object in the file; the live `read_asset` bridge counts only GameObjects
|
|
10
|
-
* + the components attached to them (it walks the loaded Transform tree, not
|
|
11
|
-
* the raw YAML). This helper returns the live-comparable counts so an
|
|
12
|
-
* acceptance test can verify the offline-reconstructed tree matches a live read
|
|
13
|
-
* node-for-node and component-for-component, without depending on the bridge.
|
|
14
|
-
*
|
|
15
|
-
* Returns `{ nodes, components }` where `nodes` is the GameObject count and
|
|
16
|
-
* `components` is the sum of components across the tree — the two numbers the
|
|
17
|
-
* live `ReadAssetTool` emits as `objectCount` (nodes+components) and
|
|
18
|
-
* `componentCount`.
|
|
19
|
-
*/
|
|
20
|
-
export declare function countHierarchy(model: AssetModel): {
|
|
21
|
-
nodes: number;
|
|
22
|
-
components: number;
|
|
23
|
-
};
|
|
24
|
-
export declare function readAssetOffline(assetPath: string, opts: {
|
|
25
|
-
fieldLimit: number;
|
|
26
|
-
projectRoot: string;
|
|
27
|
-
}): Promise<OfflineReadResult>;
|
|
28
|
-
export declare function searchAssetsOffline(opts: {
|
|
29
|
-
name?: string;
|
|
30
|
-
component?: string;
|
|
31
|
-
guid?: string;
|
|
32
|
-
type?: string;
|
|
33
|
-
folder?: string;
|
|
34
|
-
projectRoot: string;
|
|
35
|
-
maxResults?: number;
|
|
36
|
-
}): Promise<SearchModel>;
|
|
37
|
-
export interface FolderListing {
|
|
38
|
-
folder: string;
|
|
39
|
-
kinds: Record<string, {
|
|
40
|
-
count: number;
|
|
41
|
-
sample: string[];
|
|
42
|
-
}>;
|
|
43
|
-
fileCount: number;
|
|
44
|
-
}
|
|
45
|
-
export interface ListAssetsResult {
|
|
46
|
-
root: string;
|
|
47
|
-
typeFilter?: string;
|
|
48
|
-
folders: FolderListing[];
|
|
49
|
-
totalFiles: number;
|
|
50
|
-
totalFolders: number;
|
|
51
|
-
kindSummary: Record<string, number>;
|
|
52
|
-
truncated: number;
|
|
53
|
-
}
|
|
54
|
-
export declare function listAssetsOffline(opts: {
|
|
55
|
-
folder?: string;
|
|
56
|
-
type?: string;
|
|
57
|
-
maxPerFolder?: number;
|
|
58
|
-
projectRoot: string;
|
|
59
|
-
}): Promise<ListAssetsResult>;
|
|
60
|
-
export interface ReferencedByEntry {
|
|
61
|
-
assetPath: string;
|
|
62
|
-
guid?: string;
|
|
63
|
-
kind: string;
|
|
64
|
-
folder: string;
|
|
65
|
-
/** Verbose-only: field locations where the GUID appears (capped). */
|
|
66
|
-
locations?: string[];
|
|
67
|
-
}
|
|
68
|
-
export interface CollapsedGroup {
|
|
69
|
-
folder: string;
|
|
70
|
-
count: number;
|
|
71
|
-
kinds: Record<string, number>;
|
|
72
|
-
}
|
|
73
|
-
export interface FindReferencesOfflineResult {
|
|
74
|
-
queriedAssetPath: string;
|
|
75
|
-
queriedAssetGuid: string;
|
|
76
|
-
referencedBy: ReferencedByEntry[];
|
|
77
|
-
totalCount: number;
|
|
78
|
-
byKind: Record<string, number>;
|
|
79
|
-
byFolder: Record<string, number>;
|
|
80
|
-
collapsedGroups?: CollapsedGroup[];
|
|
81
|
-
detail: string;
|
|
82
|
-
truncated: number;
|
|
83
|
-
}
|
|
84
|
-
export declare function findReferencesOffline(opts: {
|
|
85
|
-
assetPath?: string;
|
|
86
|
-
guid?: string;
|
|
87
|
-
detail?: string;
|
|
88
|
-
maxResults?: number;
|
|
89
|
-
maxPerFile?: number;
|
|
90
|
-
patternThreshold?: number;
|
|
91
|
-
projectRoot: string;
|
|
92
|
-
}): Promise<FindReferencesOfflineResult>;
|
|
93
|
-
/** Edge-kind discriminator — surfaces HOW a forward edge was declared so an
|
|
94
|
-
* agent can reason about a missing ref (a broken m_Script is a different fix
|
|
95
|
-
* than a broken prefab base). Mirrors the C# Dependencies.Scanner edge kinds. */
|
|
96
|
-
export type ForwardEdgeKind = "pptr" | "script" | "prefab_source";
|
|
97
|
-
export interface ForwardEdge {
|
|
98
|
-
guid: string;
|
|
99
|
-
assetPath: string;
|
|
100
|
-
kind: ForwardEdgeKind;
|
|
101
|
-
resolved: boolean;
|
|
102
|
-
}
|
|
103
|
-
export interface ReverseEdge {
|
|
104
|
-
assetPath: string;
|
|
105
|
-
guid: string;
|
|
106
|
-
kind: string;
|
|
107
|
-
}
|
|
108
|
-
export interface ImpactEntry {
|
|
109
|
-
assetPath: string;
|
|
110
|
-
/** Hop distance from the queried asset (1 = direct reverse edge). */
|
|
111
|
-
depth: number;
|
|
112
|
-
}
|
|
113
|
-
export interface DependenciesOfflineResult {
|
|
114
|
-
queriedAssetPath: string;
|
|
115
|
-
queriedAssetGuid: string;
|
|
116
|
-
forwardDependencies: ForwardEdge[];
|
|
117
|
-
forwardCount: number;
|
|
118
|
-
/** Distinct unresolved forward-edge target GUIDs (the broken_dependency set). */
|
|
119
|
-
brokenForwardGuids: string[];
|
|
120
|
-
/** Dependency cycles passing through the queried asset (each a path list). */
|
|
121
|
-
cycles: string[][];
|
|
122
|
-
reverseDependencies: ReverseEdge[];
|
|
123
|
-
reverseCount: number;
|
|
124
|
-
/** Transitive reverse closure ("what breaks if I delete/move this?"). Empty
|
|
125
|
-
* unless opts.includeImpact is set — the walk is the expensive part. */
|
|
126
|
-
impact?: {
|
|
127
|
-
affected: ImpactEntry[];
|
|
128
|
-
affectedCount: number;
|
|
129
|
-
maxDepth: number;
|
|
130
|
-
/** True when the impact walk hit the depth bound before exhausting the
|
|
131
|
-
* graph — the affected set is a prefix, not the full closure. */
|
|
132
|
-
truncated: boolean;
|
|
133
|
-
};
|
|
134
|
-
detail: string;
|
|
135
|
-
/** Reverse-edge roster truncation count (max_results cap). */
|
|
136
|
-
truncated: number;
|
|
137
|
-
/** Non-fatal: forward-edge extraction failed to parse the queried asset as
|
|
138
|
-
* YAML (e.g. a JSON-only kind or a binary asset read offline). The forward
|
|
139
|
-
* arrays are empty and this names the reason; reverse edges are unaffected. */
|
|
140
|
-
forwardSkipped?: string;
|
|
141
|
-
_source: "offline";
|
|
142
|
-
}
|
|
143
|
-
export declare function dependenciesOffline(opts: {
|
|
144
|
-
assetPath?: string;
|
|
145
|
-
guid?: string;
|
|
146
|
-
detail?: string;
|
|
147
|
-
maxResults?: number;
|
|
148
|
-
/** Include the transitive impact closure (multi-hop reverse). Default
|
|
149
|
-
* false — the BFS is the expensive part of this call. */
|
|
150
|
-
includeImpact?: boolean;
|
|
151
|
-
/** Max hop depth for the impact BFS (default 5). Bounds the walk on large
|
|
152
|
-
* graphs. */
|
|
153
|
-
maxImpactDepth?: number;
|
|
154
|
-
/** Max depth for the forward-cycle DFS (default 8). */
|
|
155
|
-
maxCycleDepth?: number;
|
|
156
|
-
projectRoot: string;
|
|
157
|
-
}): Promise<DependenciesOfflineResult>;
|
|
158
|
-
export interface IntegrityScanEntry {
|
|
159
|
-
/** The asset/.meta path the issue is reported on. */
|
|
160
|
-
path: string;
|
|
161
|
-
code: string;
|
|
162
|
-
severity: "error" | "warning" | "info";
|
|
163
|
-
detail: string;
|
|
164
|
-
/** For duplicate_guid: the other paths sharing this GUID. */
|
|
165
|
-
relatedPaths?: string[];
|
|
166
|
-
}
|
|
167
|
-
export interface IntegrityScanResult {
|
|
168
|
-
issues: IntegrityScanEntry[];
|
|
169
|
-
byCode: Record<string, number>;
|
|
170
|
-
totalIssues: number;
|
|
171
|
-
assetsScanned: number;
|
|
172
|
-
_source: "offline";
|
|
173
|
-
}
|
|
174
|
-
/** Scan the whole Assets/ tree for project-wide integrity issues that the
|
|
175
|
-
* per-read checks cannot surface (orphaned .meta, duplicate GUIDs) plus the
|
|
176
|
-
* aggregated missing-reference set. Offline counterpart of a full verify
|
|
177
|
-
* scan_paths run for these three rule families. */
|
|
178
|
-
export declare function scanIntegrityOffline(opts: {
|
|
179
|
-
projectRoot: string;
|
|
180
|
-
}): Promise<IntegrityScanResult>;
|
|
1
|
+
export { readAssetOffline, searchAssetsOffline, listAssetsOffline, findReferencesOffline, dependenciesOffline, scanIntegrityOffline, isOfflineAsset, countHierarchy, } from "./offline/api.js";
|
|
2
|
+
export type { OfflineReadResult, FolderListing, ListAssetsResult, ReferencedByEntry, CollapsedGroup, FindReferencesOfflineResult, ForwardEdgeKind, ForwardEdge, ReverseEdge, ImpactEntry, DependenciesOfflineResult, IntegrityScanEntry, IntegrityScanResult, } from "./offline/api.js";
|