@openfairygui/backend 0.6.1 → 0.6.3
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/dist/docs.cjs +28 -12
- package/dist/docs.mjs +28 -12
- package/package.json +3 -3
- package/src/generated/contracts.ts +76 -28
- package/src/generated/docs.ts +2 -2
package/dist/docs.cjs
CHANGED
|
@@ -3758,6 +3758,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
3758
3758
|
},
|
|
3759
3759
|
"resource": { "$ref": "#/$defs/UamResourceRef_3486136f6c" },
|
|
3760
3760
|
"controllerOverrides": { "type": "string" },
|
|
3761
|
+
"pageController": { "type": "string" },
|
|
3762
|
+
"fileName": { "type": "string" },
|
|
3761
3763
|
"instanceProperties": { "$ref": "#/$defs/Shape_8a3021d271" },
|
|
3762
3764
|
"propertyOverrides": { "$ref": "#/$defs/Array_7c27bc0bce" },
|
|
3763
3765
|
"group": { "type": "string" },
|
|
@@ -4771,6 +4773,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
4771
4773
|
"titleFontSize": { "type": "number" },
|
|
4772
4774
|
"sound": { "type": "string" },
|
|
4773
4775
|
"soundVolumeScale": { "type": "number" },
|
|
4776
|
+
"pageController": { "type": "string" },
|
|
4774
4777
|
"src": { "type": "string" },
|
|
4775
4778
|
"packageId": { "type": "string" },
|
|
4776
4779
|
"group": { "type": "string" },
|
|
@@ -4860,6 +4863,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
4860
4863
|
"titleFontSize": { "type": "number" },
|
|
4861
4864
|
"sound": { "type": "string" },
|
|
4862
4865
|
"soundVolumeScale": { "type": "number" },
|
|
4866
|
+
"pageController": { "type": "string" },
|
|
4863
4867
|
"src": { "type": "string" },
|
|
4864
4868
|
"packageId": { "type": "string" },
|
|
4865
4869
|
"group": { "type": "string" },
|
|
@@ -4950,6 +4954,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
4950
4954
|
"titleFontSize": { "type": "number" },
|
|
4951
4955
|
"sound": { "type": "string" },
|
|
4952
4956
|
"soundVolumeScale": { "type": "number" },
|
|
4957
|
+
"pageController": { "type": "string" },
|
|
4953
4958
|
"src": { "type": "string" },
|
|
4954
4959
|
"packageId": { "type": "string" },
|
|
4955
4960
|
"group": { "type": "string" },
|
|
@@ -5041,6 +5046,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
5041
5046
|
"reverse": { "type": "boolean" },
|
|
5042
5047
|
"sound": { "type": "string" },
|
|
5043
5048
|
"soundVolumeScale": { "type": "number" },
|
|
5049
|
+
"pageController": { "type": "string" },
|
|
5044
5050
|
"src": { "type": "string" },
|
|
5045
5051
|
"packageId": { "type": "string" },
|
|
5046
5052
|
"group": { "type": "string" },
|
|
@@ -5125,6 +5131,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
5125
5131
|
"max": { "type": "number" },
|
|
5126
5132
|
"value": { "type": "number" },
|
|
5127
5133
|
"wholeNumbers": { "type": "boolean" },
|
|
5134
|
+
"pageController": { "type": "string" },
|
|
5128
5135
|
"src": { "type": "string" },
|
|
5129
5136
|
"packageId": { "type": "string" },
|
|
5130
5137
|
"group": { "type": "string" },
|
|
@@ -5203,6 +5210,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
5203
5210
|
"const": "scrollBar"
|
|
5204
5211
|
},
|
|
5205
5212
|
"fixedGripSize": { "type": "boolean" },
|
|
5213
|
+
"pageController": { "type": "string" },
|
|
5206
5214
|
"src": { "type": "string" },
|
|
5207
5215
|
"packageId": { "type": "string" },
|
|
5208
5216
|
"group": { "type": "string" },
|
|
@@ -8990,8 +8998,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
8990
8998
|
"const": "image"
|
|
8991
8999
|
},
|
|
8992
9000
|
"favorite": { "type": "boolean" },
|
|
8993
|
-
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
8994
9001
|
"fileName": { "type": "string" },
|
|
9002
|
+
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
8995
9003
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
8996
9004
|
},
|
|
8997
9005
|
"required": [
|
|
@@ -9021,8 +9029,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9021
9029
|
"const": "movieClip"
|
|
9022
9030
|
},
|
|
9023
9031
|
"favorite": { "type": "boolean" },
|
|
9024
|
-
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9025
9032
|
"fileName": { "type": "string" },
|
|
9033
|
+
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9026
9034
|
"dimensions": { "$ref": "#/$defs/UamDimensions_78dd3aa7d8" }
|
|
9027
9035
|
},
|
|
9028
9036
|
"required": [
|
|
@@ -9057,8 +9065,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9057
9065
|
"dragonBones"
|
|
9058
9066
|
] },
|
|
9059
9067
|
"favorite": { "type": "boolean" },
|
|
9060
|
-
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9061
9068
|
"fileName": { "type": "string" },
|
|
9069
|
+
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9062
9070
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
9063
9071
|
},
|
|
9064
9072
|
"required": [
|
|
@@ -9372,9 +9380,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9372
9380
|
"const": "image"
|
|
9373
9381
|
},
|
|
9374
9382
|
"favorite": { "type": "boolean" },
|
|
9383
|
+
"fileName": { "type": "string" },
|
|
9375
9384
|
"sourcePath": { "type": "string" },
|
|
9376
9385
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9377
|
-
"fileName": { "type": "string" },
|
|
9378
9386
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
9379
9387
|
},
|
|
9380
9388
|
"required": [
|
|
@@ -9404,9 +9412,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9404
9412
|
"const": "movieClip"
|
|
9405
9413
|
},
|
|
9406
9414
|
"favorite": { "type": "boolean" },
|
|
9415
|
+
"fileName": { "type": "string" },
|
|
9407
9416
|
"sourcePath": { "type": "string" },
|
|
9408
9417
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9409
|
-
"fileName": { "type": "string" },
|
|
9410
9418
|
"dimensions": { "$ref": "#/$defs/UamDimensions_78dd3aa7d8" }
|
|
9411
9419
|
},
|
|
9412
9420
|
"required": [
|
|
@@ -9442,9 +9450,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9442
9450
|
"dragonBones"
|
|
9443
9451
|
] },
|
|
9444
9452
|
"favorite": { "type": "boolean" },
|
|
9453
|
+
"fileName": { "type": "string" },
|
|
9445
9454
|
"sourcePath": { "type": "string" },
|
|
9446
9455
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9447
|
-
"fileName": { "type": "string" },
|
|
9448
9456
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
9449
9457
|
},
|
|
9450
9458
|
"required": [
|
|
@@ -12127,6 +12135,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
12127
12135
|
},
|
|
12128
12136
|
"resource": { "$ref": "#/$defs/UamResourceRef_3486136f6c_read" },
|
|
12129
12137
|
"controllerOverrides": { "type": "string" },
|
|
12138
|
+
"pageController": { "type": "string" },
|
|
12139
|
+
"fileName": { "type": "string" },
|
|
12130
12140
|
"instanceProperties": { "$ref": "#/$defs/Shape_8a3021d271_read" },
|
|
12131
12141
|
"propertyOverrides": { "$ref": "#/$defs/Array_7c27bc0bce_read" },
|
|
12132
12142
|
"group": { "type": "string" },
|
|
@@ -13158,6 +13168,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13158
13168
|
"titleFontSize": { "type": "number" },
|
|
13159
13169
|
"sound": { "type": "string" },
|
|
13160
13170
|
"soundVolumeScale": { "type": "number" },
|
|
13171
|
+
"pageController": { "type": "string" },
|
|
13161
13172
|
"src": { "type": "string" },
|
|
13162
13173
|
"packageId": { "type": "string" },
|
|
13163
13174
|
"group": { "type": "string" },
|
|
@@ -13247,6 +13258,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13247
13258
|
"titleFontSize": { "type": "number" },
|
|
13248
13259
|
"sound": { "type": "string" },
|
|
13249
13260
|
"soundVolumeScale": { "type": "number" },
|
|
13261
|
+
"pageController": { "type": "string" },
|
|
13250
13262
|
"src": { "type": "string" },
|
|
13251
13263
|
"packageId": { "type": "string" },
|
|
13252
13264
|
"group": { "type": "string" },
|
|
@@ -13337,6 +13349,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13337
13349
|
"titleFontSize": { "type": "number" },
|
|
13338
13350
|
"sound": { "type": "string" },
|
|
13339
13351
|
"soundVolumeScale": { "type": "number" },
|
|
13352
|
+
"pageController": { "type": "string" },
|
|
13340
13353
|
"src": { "type": "string" },
|
|
13341
13354
|
"packageId": { "type": "string" },
|
|
13342
13355
|
"group": { "type": "string" },
|
|
@@ -13428,6 +13441,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13428
13441
|
"reverse": { "type": "boolean" },
|
|
13429
13442
|
"sound": { "type": "string" },
|
|
13430
13443
|
"soundVolumeScale": { "type": "number" },
|
|
13444
|
+
"pageController": { "type": "string" },
|
|
13431
13445
|
"src": { "type": "string" },
|
|
13432
13446
|
"packageId": { "type": "string" },
|
|
13433
13447
|
"group": { "type": "string" },
|
|
@@ -13512,6 +13526,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13512
13526
|
"max": { "type": "number" },
|
|
13513
13527
|
"value": { "type": "number" },
|
|
13514
13528
|
"wholeNumbers": { "type": "boolean" },
|
|
13529
|
+
"pageController": { "type": "string" },
|
|
13515
13530
|
"src": { "type": "string" },
|
|
13516
13531
|
"packageId": { "type": "string" },
|
|
13517
13532
|
"group": { "type": "string" },
|
|
@@ -13590,6 +13605,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13590
13605
|
"const": "scrollBar"
|
|
13591
13606
|
},
|
|
13592
13607
|
"fixedGripSize": { "type": "boolean" },
|
|
13608
|
+
"pageController": { "type": "string" },
|
|
13593
13609
|
"src": { "type": "string" },
|
|
13594
13610
|
"packageId": { "type": "string" },
|
|
13595
13611
|
"group": { "type": "string" },
|
|
@@ -13829,9 +13845,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13829
13845
|
"const": "image"
|
|
13830
13846
|
},
|
|
13831
13847
|
"favorite": { "type": "boolean" },
|
|
13848
|
+
"fileName": { "type": "string" },
|
|
13832
13849
|
"sourcePath": { "type": "string" },
|
|
13833
13850
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618_read" },
|
|
13834
|
-
"fileName": { "type": "string" },
|
|
13835
13851
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846_read" },
|
|
13836
13852
|
"sourceBytes": { "not": {} }
|
|
13837
13853
|
},
|
|
@@ -13900,9 +13916,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13900
13916
|
"const": "movieClip"
|
|
13901
13917
|
},
|
|
13902
13918
|
"favorite": { "type": "boolean" },
|
|
13919
|
+
"fileName": { "type": "string" },
|
|
13903
13920
|
"sourcePath": { "type": "string" },
|
|
13904
13921
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618_read" },
|
|
13905
|
-
"fileName": { "type": "string" },
|
|
13906
13922
|
"dimensions": { "$ref": "#/$defs/UamDimensions_78dd3aa7d8_read" },
|
|
13907
13923
|
"sourceBytes": { "not": {} }
|
|
13908
13924
|
},
|
|
@@ -13981,9 +13997,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13981
13997
|
"dragonBones"
|
|
13982
13998
|
] },
|
|
13983
13999
|
"favorite": { "type": "boolean" },
|
|
14000
|
+
"fileName": { "type": "string" },
|
|
13984
14001
|
"sourcePath": { "type": "string" },
|
|
13985
14002
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618_read" },
|
|
13986
|
-
"fileName": { "type": "string" },
|
|
13987
14003
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846_read" },
|
|
13988
14004
|
"sourceBytes": { "not": {} }
|
|
13989
14005
|
},
|
|
@@ -16095,16 +16111,16 @@ const CONTRACT_SNAPSHOT = {
|
|
|
16095
16111
|
}
|
|
16096
16112
|
}
|
|
16097
16113
|
],
|
|
16098
|
-
"digest": "
|
|
16114
|
+
"digest": "5718c7534651570432e9dda5a5cda367cbc292e71e59f5f6ad2e1c55321dee5a"
|
|
16099
16115
|
};
|
|
16100
16116
|
//#endregion
|
|
16101
16117
|
//#region src/generated/docs.ts
|
|
16102
16118
|
const INSTALLED_DOCS = {
|
|
16103
16119
|
"version": {
|
|
16104
16120
|
"packageName": "@openfairygui/backend",
|
|
16105
|
-
"packageVersion": "0.6.
|
|
16121
|
+
"packageVersion": "0.6.3",
|
|
16106
16122
|
"nodeEngine": ">=22",
|
|
16107
|
-
"documentationDigest": "
|
|
16123
|
+
"documentationDigest": "08afcb7b44b538e1592058f3e20e94c276b86573858962f1b6591cd34ac74b39"
|
|
16108
16124
|
},
|
|
16109
16125
|
"workflow": "# Installed OpenFairyGUI workflow\n\nThis is a minimal offline companion, not the full website. Read `ofgui docs ls --json` for the installed package version, contract version, capability schema version and digest. Use the project's installed `ofgui`/`ofgui-mcp`, not a global executable or an online latest-version lookup. A mismatched installation must be reconciled by the host before editing.\n\n## Discover the current contract\n\n- `ofgui docs find \"selector\" --json` searches this installed corpus.\n- `ofgui docs cat contracts --json` lists Core operations and Backend/MCP mappings.\n- `ofgui docs schema setDisplayNodeProps --json` reads one self-contained operation schema.\n- `ofgui docs schema cli/validate --json` reads the installed CLI output schema; `cli/docs cat` is a valid exact document ID for the nested command.\n- `ofgui docs cat methods/queryEntity --json` reads precise input/output wire schemas.\n- `ofgui docs diagnostic stale_write --json` reads recovery guidance.\n- MCP `resources/read` at `openfairygui://docs/index` provides the same index and content URIs. MCP is local stdio, not an assumed HTTP port.\n\nThe generated schemas describe JSON wire structure and input budgets, not semantic validity. Native SDK byte fields remain Uint8Array; MCP transports declared byte fields as integer arrays. Arbitrary extension data is not converted. Host objects/functions are omitted from MCP wire schemas; use SDK declarations for host injection, not guessed JSON fields.\n\nMCP allows up to 8 MiB of aggregate byte input at generated byte paths, without applying the general 10000-element array or per-byte node limits. Arbitrary metadata retains general limits. All value-bearing Gear defaults may be null, preserving the owner's initial state when no default override exists; component-instance controllerOverrides retains controller selections.\n\nAll CLI JSON uses `{schemaVersion:1,command,success:true,result}` or `{schemaVersion:1,command,success:false,error:{code,message},result?}`. Documentation version/index/body fields are inside `result`; read `result.text` for document content. Invalid/incomplete validate and doctor responses retain their full report under `result`. Help/version are text; other JSON-mode stdout contains exactly one document and human logs use stderr. Exit codes: 0 success, 1 workflow failure, 2 arguments, 3 incomplete validation. CLI owns envelopes, not new workflow semantics.\n\n## Edit safely\n\n1. Read capabilities. Existing projects use openSession (with host authorization and a lifetime lock); openProjectSession accepts a host-supplied authoritative UAM, not a shortcut around lossy file-session guards.\n2. Read getProjectOutline to discover exact identities, then queryEntity for the relevant current properties and actual revision. Capabilities list the supported read.entityQuery.kinds: project, package, resource, component, displayNode, controller and transition. Project queries use target {kind:\"project\"} without a selector; package queries use {kind:\"package\",selector:{packageId}}. Both return identity and complete entity.properties.settings. Controllers use packageId + componentResourceId + controllerName; transitions use packageId + componentResourceId + transitionName. Names are exact and component-scoped; duplicates fail as ambiguous. Controller snapshots include pages/actions; transition snapshots include items. Gears are already included in displayNode snapshots. Fixed projections exclude source bytes; budget failures require host inspection.\n3. Read the operation and method schemas. Plan the smallest authorized batch using current identifiers and expectedRevision.\n4. preflightTransaction executes on an isolated snapshot and discards it. Inspect projectedRevision, impact.entities (exact identities and changed fields, including reference normalization), impact.files (ProjectWriter model diff, not a disk write plan) and persistence.nextAction. The diff starts at the current revision, not the last save. It contains no source bytes. Summary overflow or serialization failure returns transaction_preview_failed without a partial result. No revision is reserved; writeVerified is always false. It does not save files or guarantee later apply/save/publish.\n5. Only when authorized, applyTransaction with the planned batch and expectedRevision. On stale_write, refresh and replan; never blindly substitute a newer revision.\n6. validateSession checks the new authoritative state. A successful response can contain an invalid or incomplete validation report; require status valid and complete true before treating validation as passed.\n7. When authorized, saveSession checks revision independently and writes the original project only. Keep path policy, UAM fidelity and rollback guards. Close the session only after handling unsaved changes. Read saved output again when disk round-trip is part of acceptance.\n\nPreview permits invalid references in the existing snapshot so a repair can be reviewed, but serializes that snapshot only into memory. The projected state and all persistence remain validated; unsupported or unrepresentable snapshots still fail explicitly.\n\nupdateProjectSettings and updatePackageSettings replace complete settings snapshots. Copy the corresponding query's entity.properties.settings, change only requested fields, retain other nested settings and optional fields, and submit the complete settings with the queried revision. Package updates also require the original packageId selector. Settings queries share the same response budgets as other entity kinds.\n\nupdateController and updateTransition replace complete snapshots, not partial patches. Copy the queried entity.properties, change only the requested fields, preserve page IDs/remarks/actions, item order/targets, settings and references, and submit the original selector with the queried revision. A stale_write requires refreshing and replanning the full snapshot for all these replacement operations. Querying does not validate references or grant permission to edit them.\n\n## Consume the committed session state\n\nFor complete public UAM consumption, use readSessionState({sessionId, expectedRevision?}); use queryEntity for targeted properties. The detached model excludes only asset resources' primary sourceBytes, retaining sourcePath and JSON extensions. It includes revision, dirty, lastSavedRevision, readComplete, readDiagnostics and uamFidelity. Only this read-model output schema accepts unnamed object fields; transaction input contracts remain unchanged.\n\nRead each asset with readResourceBytes({sessionId, expectedRevision: state.revision, selector:{packageId,resourceId}}). Bytes are detached Uint8Array values in the SDK and integer arrays in MCP, limited to the primary file already held in memory. There is no disk hydration or auxiliary-file discovery. Components are unsupported; unavailable bytes produce session_read_failed with reason bytes_unavailable.\n\nOn stale_read, discard the incomplete model/bytes collection and restart from readSessionState. Reads do not wait for uncommitted transactions, retain historical versions, or reserve revisions. Saving can update sourcePath and dirty without increasing the edit revision; the same revision does not identify permanently identical complete UAM. Completeness/fidelity flags preserve existing meaning and do not guarantee bytes, rendering or saving. Preserve failed reads as failures; never save or repair merely to obtain a read.\n\nCapabilities advertise a 4 MiB compact JSON data limit (depth 64, 500000 nodes) for the model and 1 MiB per primary resource. Both new MCP tools additionally limit the complete JSON CallToolResult, including compact text and structuredContent, to 16 MiB; excess returns mcp_response_budget_exceeded. Native model/buffer overflow returns session_read_failed with reason response_budget_exceeded, without truncation. Read the installed methods/readSessionState and methods/readResourceBytes schemas for precise inputs, results and errors.\n\n## Diagnose without repair\n\n`ofgui doctor --json` checks installed CLI/documentation versions, the Node Backend capability snapshot, in-memory Sharp PNG/JPEG encoding and pixel decoding, and temporary-directory access flags. `ofgui doctor <project-directory-or-fairy-file> --json` additionally runs existing Node project validation, including source reads and available image decoding. Optional `--output-dir <directory>` checks an explicit destination or its nearest existing ancestor, without creating it. Directory checks return the absolute requested `path`, link-resolved `inspectedPath` and `exists` (null when unknown); files, dangling links and access errors fail. The temporary directory must exist. It opens no Backend session, creates no lock, installs nothing, writes no probe files and changes no configuration.\n\nExit 0 means the requested checks completed; exit 1 means a detected error; exit 2 means invalid arguments; exit 3 means native image capability is unavailable/failed or project validation is incomplete. Inspect result.checks, result.errors and result.project. Without a project, its source bytes are not checked. Access flags do not prove effective ACL permissions, available space, later writes/rename/rollback or continued access. The capability manifest remains a declaration; a successful doctor does not prove publish/restore or runtime rendering. Plugins and configured output destinations are not executed or checked automatically; only explicit --output-dir is inspected. This product doctor does not inspect Git, pnpm, repository builds or fixture submodules; maintainers use pnpm repo:doctor for those.\n\nRead diagnostic guides for ownership and recovery boundaries. Every formal Core/Backend diagnostic code is covered; shared codes list all `owners`, while response `owner` identifies the actual source. Missing bytes/decoders, rejected paths and expired sessions require host action; do not invent repair/hydration tools, widen roots, discard unsaved work, or turn incomplete validation into success. Invalid/unsupported operations require schema-based replanning, live locks cannot be removed, and write failures require preserving dirty state and inspecting actual files.\n\n## Publish and recover trusted local artifacts\n\nPublishing and restoration are external Node-hosted workflows, not Backend session methods or general MCP editing tools. The host must authorize input and output directories independently. They require the native image capability; do not rename binary extensions to imitate a different target profile.\n\n- `ofgui publish <project> --output <release-directory> --project-type layabox --json` publishes the current saved project. `--output` overrides runtime artifact destinations; configured code generation still uses its own destinations and project plugins run as trusted local code.\n- The JSON document is `{schemaVersion:1,command:\"publish\",success:true,result:{files:[{path,size}]}}`. Paths are final absolute paths and sizes are bytes. The Node SDK `publishNode()` returns the same `result`. The manifest records actual successful filesystem/atlas writes, including code written through the supplied publish filesystem; it excludes pre-existing untouched files, deletions and arbitrary plugin I/O outside that filesystem. It is not an inventory of everything in the output directory. Explicit runtime output is staged and rolled back on failure; separately configured code outputs and arbitrary plugin effects are not covered by that directory transaction.\n- `ofgui restore <trusted-release-directory> --output <separate-project-directory> --project-type layabox --json` returns `{schemaVersion:1,command:\"restore\",success:true,result:{projectPath,packages:[{id,name}],warnings:[]}}`. Warnings are not a validation pass. Reread the returned projectPath and run `ofgui validate <projectPath> --json`; require valid and complete validation.\n- Both artifact commands exit 0 on workflow success, 1 on workflow failure, and 2 on command syntax errors. Errors are `{schemaVersion:1,command,success:false,error:{code,message}}`, with `publish_failed`, `restore_failed` or `invalid_arguments`. In JSON mode stdout contains only this document; human/plugin output goes to stderr. Help remains human-readable. Errors do not include a claimed successful file manifest.\n- Restore requires a separate directory, not a `.fairy` file. Do not force overwrite by default. `--force` replaces an existing nonempty target only after complete staged recovery; parse/image failures retain the previous target. Only trusted local artifacts are supported, not arbitrary third-party imports.\n- Read `ofgui docs cat restore-limits --json` or MCP resource `openfairygui://docs/restore-limits` for the installed version's full recovery boundary. Accept readable, structurally valid supported semantics and decoded assets, not original project IDs, workspace state, unpublished resources, original filenames/extensions, controller editor selection/export flags, float32 text precision or byte-identical XML.\n",
|
|
16110
16126
|
"restoreLimits": "# 受限发布产物恢复边界\n\n`restore` 只是一条受限的本地故障恢复路径,不是 FairyGUI 的常规创作入口、第三方发布物导入器或源码还原承诺。本文档记录其安全使用范围,以及当前仓库已经验证过、无法仅凭发布产物稳定恢复的内容。\n\n## 使用范围与安全边界\n\n| 项目 | 当前口径 |\n|---|---|\n| 输入 | 仅处理可信的本地发布目录;不把未知来源 `.fui` / `_fui.bytes` 视为安全输入 |\n| 输出 | 必须是独立工程目录,不接受 `.fairy` 单文件目标 |\n| 路径约束 | 拒绝资源路径、包名、分支名、文件名中的路径逃逸;发布目录内资源若解析到输入目录外也会失败 |\n| 覆盖行为 | 先在相邻暂存目录完成工程和资源写入,再替换目标;`--force` 不会在二进制解析或资源重建前删除旧输出 |\n| 不代表 | 不是恶意文件检测器,也不保证第三方产物能够安全或完整恢复 |\n\n这里的“不可还原”指:\n\n| 项目 | 含义 |\n|---|---|\n| 输入范围 | 仅使用发布目录中的 `.fui` / `_fui.bytes`、图集 PNG、以及同目录 loose 资源 |\n| 判定标准 | 不能稳定、通用、无外部辅助地恢复回原工程语义或原始 XML 文本 |\n| 不包含 | 仍可通过补协议、补 writer 规则、补测试继续收敛的普通实现问题 |\n\n## 总结\n\n| 结论 | 说明 |\n|---|---|\n| 受限恢复目标 | 在可信输入下生成一个可重读、可打开、结构自洽的 FairyGUI 工程 |\n| 不保证目标 | 还原成与原工程逐字节一致的源码工程 |\n| 主要原因 | 发布产物会丢失一部分编辑器阶段信息,或把原始值降精度到运行时格式 |\n\n## 当前已确认的不可还原项\n\n恢复时推导出的图片尺寸用于资源重建,但不作为原始声明尺寸写入 `package.xml`;生成的字体纹理和字形图片按顺序跟随对应字体。`RestoreResult.document` 保留尺寸省略与资源排序两种写入提示,交给新的 `ProjectWriter` 或 `NodeIO.writeProject()` 仍生效。提示属于内存中的序列化控制,不随 UAM 转换或重新读取传播。`ProjectWriter.setImageWriteHints(image, {})` 清除该图片的全部提示,恢复普通尺寸写回和资源排序;需要保留排序时,设置 `{ packageOrder: { afterId, weight } }`,其中目标是同包、同分支且未设置排序提示的资源。\n\n### 1. 发布包中根本不存在的资源或动作\n\n发布物中缺失独立资源项的字形图像使用稳定 glyph 图像 ID 的 UTF-8 十六进制生成 `images/glyph-<id>.png`,不同字体的不同图像 ID 不会因字符相同而重名。已有资源项保留发布物中的名称和路径;生成名称不代表原始源文件名,不依据示例包名或字体名称猜测。\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 组件资源 | 原工程存在、但发布包未携带的组件 XML | 发布产物没有资源定义,restore 无法凭空生成真实内容 | `HitTest/component1.xml`、`PullToRefresh/Button1.xml`、`PullToRefresh/Button2.xml`、`TurnPage/Button3.xml` |\n| Transition item | 原工程存在、但二进制 transition block 未携带的 item | 二进制里没有对应时间轴项,无法可靠反推 | `Transition/BOSS.xml` 中 `target=\"n3\"` 的 6 个 item |\n\n说明:这类内容如果强行补出,只能生成占位内容,不能声称是“还原原工程”。\n\n### 2. 原始资源文件名与扩展名\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 普通图片资源 | 原工程使用的真实文件扩展名与双后缀命名 | 发布包只保留运行时资源名,不稳定保留工程文件名 | `change.jpg -> change.png`、`Paper.jpg -> Paper.png`、`i3.png.png -> i3.png` |\n| 部分 loose 资源 | 若发布名与工程名完全脱钩,且缺少稳定映射线索 | 发布目录只提供发布后文件名,原工程命名信息已经丢失 | 仍可能出现少量发布名残留 |\n\n说明:当前实现已经尽量把“资源 id 命名”还原回工程名,但对原始扩展名并不能做通用、可靠的反推。\n\n### 3. Transition path 的原始文本精度\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 路径字符串 | 编辑器 XML 中 path 的原始小数位数与文本格式 | 发布二进制只保存 float32 数值;写回时只能输出数值等价的字符串 | `Transition/PathDemo.xml` 的 `path` |\n\n说明:这类路径通常还能恢复到相同几何轨迹,但不能保证与原 XML 的字符串完全一致。\n\n### 4. 被降级为运行时默认值的编辑器信息\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| Transition easing | 原工程中的特定 ease 名称 | 当前样本对应二进制读出的就是默认 easing,无法证明原工程曾写过哪个非默认 ease | `Transition/BOSS.xml`、`TRAP.xml`、`GoodHit.xml` 中部分 `Expo.Out` / `Back.Out` / `Bounce.Out` |\n| 简单 Group 节点 | 仅用于编辑器分组、但没有额外运行时语义的 `GGroup` 节点 | 当前样本中的发布组件数据会直接裁掉这类 group,二进制 child list 里既没有 group 节点,也没有可稳定回推的 group 归属索引 | `Basics/Demo_Clip&Scroll.xml`、`Emoji/Main.xml`、`TurnPage/Book.xml` |\n| Group 高级模式 | 原工程 XML 中的 `group.advanced=\"true\"` | 发布 group block写出的是布局与间距等运行时数据,不单独保留编辑器里的高级模式开关;当前样本中二进制读回的 group 会直接落成 `advanced=false` | `Basics/Demo_Grid.xml`、`Transition/Main.xml`、`Transition/PowerUp.xml` |\n| Controller 当前选中页 | 原工程 XML 中的 `controller.selected` 当前页状态 | 发布 controller block稳定保存的是 `homePageType/homePage` 发布首页信息;当前样本中的二进制常写成 `default`,并不保留编辑器工程里当时的非零当前页 | `TurnPage/Main.xml` 的 `bookPos=\"2\"`、`TurnPage/Page.xml` 的 `style=\"1\"` / `side=\"1\"`、`FrontCover.xml` / `BackCover.xml` 的 `side=\"1\"` |\n| Controller 导出标记 | 原工程 XML 中的 `controller.exported=\"true\"` | 当前样本对应的 controller 发布 block只写 `name/pages/homePageType/homePage/actions`,没有独立写出 `exported` | `TurnPage/BackCover.xml`、`TurnPage/FrontCover.xml`、`TurnPage/Page.xml` |\n| 默认值显式性 | 原工程是否显式写出默认属性 | 发布包只保留语义值,不保留“这个默认值当时是否显式写在 XML 里” | 如 `xy=\"0,0\"`、空文本、默认布尔值等 |\n\n说明:这类信息恢复后通常仍然语义可用,但无法保证与原工程的编辑器写法逐项一致。\n\n### 5. 编辑器工程本地设置\n\n| 类别 | 不可还原内容 | 原因 |\n|---|---|---|\n| 工程标识 | 原始 `projectId` | restore 会生成新的工程标识 |\n| 工程设置 | 原始 `.objs` / workspace / 编辑器本地状态 | 发布目录不包含这些本地工程文件 |\n| 初始化设置之外的项目配置 | 原工程的非发布产物配置 | 当前 restore 按初始化默认值生成工程设置,而不是恢复源工程工作区状态 |\n\n说明:当前 restore 的目标是“重建可用工程”,不是恢复编辑器本地工作环境。\n\n### 6. 原工程 XML 的文本级细节\n\n| 类别 | 不可还原内容 | 原因 |\n|---|---|---|\n| 属性顺序 | 原标签属性排列顺序 | XML 语义不依赖属性顺序,发布产物也不保留该信息 |\n| 格式风格 | 换行、缩进、是否自闭合、空格风格 | 这是 writer 生成结果,不是发布产物协议内容 |\n| 大小写风格 | 某些颜色值、小数文本风格 | 发布包保留的是数值语义,不是原文本样式 |\n\n说明:当前实现会尽量贴近 FairyGUI 编辑器写法,但不会把这类文本风格视为“可从发布产物逆推出的正式数据”。\n\n## 当前恢复输出范围\n\n| 项目 | 当前口径 |\n|---|---|\n| 工程目标 | 在可信输入下生成可读、可打开、可继续编辑的 FairyGUI 工程 |\n| 资源目标 | 尽量恢复包内素材、组件 XML、字体派生图与 `.jta` / `.fnt` 等正式资源 |\n| 不承诺 | 与原工程一模一样的文件名、文本格式、局部编辑器状态 |\n\n## 何时需要外部辅助信息\n\n若目标不是“重建可用工程”,而是“尽量贴近原工程文本或命名”,则需要额外输入:\n\n| 额外输入 | 作用 |\n|---|---|\n| 原工程目录 | 作为命名、路径、缺失资源、文本样式的真实基准 |\n| 编辑器工作区文件 | 恢复 `.objs`、workspace、本地工程状态 |\n| 发布前清单或映射表 | 回填发布名与工程名之间的脱钩关系 |\n\n## 当前样本下仍然成立的判断\n\n| 判断 | 说明 |\n|---|---|\n| 可以从发布产物重建“可工作的工程” | 是 |\n| 可以从发布产物重建“原工程的源码真迹” | 否 |\n| 还原结果是否应该继续优化 | 可以,但应只优化“发布产物里确实有证据的部分” |\n",
|
package/dist/docs.mjs
CHANGED
|
@@ -3757,6 +3757,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
3757
3757
|
},
|
|
3758
3758
|
"resource": { "$ref": "#/$defs/UamResourceRef_3486136f6c" },
|
|
3759
3759
|
"controllerOverrides": { "type": "string" },
|
|
3760
|
+
"pageController": { "type": "string" },
|
|
3761
|
+
"fileName": { "type": "string" },
|
|
3760
3762
|
"instanceProperties": { "$ref": "#/$defs/Shape_8a3021d271" },
|
|
3761
3763
|
"propertyOverrides": { "$ref": "#/$defs/Array_7c27bc0bce" },
|
|
3762
3764
|
"group": { "type": "string" },
|
|
@@ -4770,6 +4772,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
4770
4772
|
"titleFontSize": { "type": "number" },
|
|
4771
4773
|
"sound": { "type": "string" },
|
|
4772
4774
|
"soundVolumeScale": { "type": "number" },
|
|
4775
|
+
"pageController": { "type": "string" },
|
|
4773
4776
|
"src": { "type": "string" },
|
|
4774
4777
|
"packageId": { "type": "string" },
|
|
4775
4778
|
"group": { "type": "string" },
|
|
@@ -4859,6 +4862,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
4859
4862
|
"titleFontSize": { "type": "number" },
|
|
4860
4863
|
"sound": { "type": "string" },
|
|
4861
4864
|
"soundVolumeScale": { "type": "number" },
|
|
4865
|
+
"pageController": { "type": "string" },
|
|
4862
4866
|
"src": { "type": "string" },
|
|
4863
4867
|
"packageId": { "type": "string" },
|
|
4864
4868
|
"group": { "type": "string" },
|
|
@@ -4949,6 +4953,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
4949
4953
|
"titleFontSize": { "type": "number" },
|
|
4950
4954
|
"sound": { "type": "string" },
|
|
4951
4955
|
"soundVolumeScale": { "type": "number" },
|
|
4956
|
+
"pageController": { "type": "string" },
|
|
4952
4957
|
"src": { "type": "string" },
|
|
4953
4958
|
"packageId": { "type": "string" },
|
|
4954
4959
|
"group": { "type": "string" },
|
|
@@ -5040,6 +5045,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
5040
5045
|
"reverse": { "type": "boolean" },
|
|
5041
5046
|
"sound": { "type": "string" },
|
|
5042
5047
|
"soundVolumeScale": { "type": "number" },
|
|
5048
|
+
"pageController": { "type": "string" },
|
|
5043
5049
|
"src": { "type": "string" },
|
|
5044
5050
|
"packageId": { "type": "string" },
|
|
5045
5051
|
"group": { "type": "string" },
|
|
@@ -5124,6 +5130,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
5124
5130
|
"max": { "type": "number" },
|
|
5125
5131
|
"value": { "type": "number" },
|
|
5126
5132
|
"wholeNumbers": { "type": "boolean" },
|
|
5133
|
+
"pageController": { "type": "string" },
|
|
5127
5134
|
"src": { "type": "string" },
|
|
5128
5135
|
"packageId": { "type": "string" },
|
|
5129
5136
|
"group": { "type": "string" },
|
|
@@ -5202,6 +5209,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
5202
5209
|
"const": "scrollBar"
|
|
5203
5210
|
},
|
|
5204
5211
|
"fixedGripSize": { "type": "boolean" },
|
|
5212
|
+
"pageController": { "type": "string" },
|
|
5205
5213
|
"src": { "type": "string" },
|
|
5206
5214
|
"packageId": { "type": "string" },
|
|
5207
5215
|
"group": { "type": "string" },
|
|
@@ -8989,8 +8997,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
8989
8997
|
"const": "image"
|
|
8990
8998
|
},
|
|
8991
8999
|
"favorite": { "type": "boolean" },
|
|
8992
|
-
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
8993
9000
|
"fileName": { "type": "string" },
|
|
9001
|
+
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
8994
9002
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
8995
9003
|
},
|
|
8996
9004
|
"required": [
|
|
@@ -9020,8 +9028,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9020
9028
|
"const": "movieClip"
|
|
9021
9029
|
},
|
|
9022
9030
|
"favorite": { "type": "boolean" },
|
|
9023
|
-
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9024
9031
|
"fileName": { "type": "string" },
|
|
9032
|
+
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9025
9033
|
"dimensions": { "$ref": "#/$defs/UamDimensions_78dd3aa7d8" }
|
|
9026
9034
|
},
|
|
9027
9035
|
"required": [
|
|
@@ -9056,8 +9064,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9056
9064
|
"dragonBones"
|
|
9057
9065
|
] },
|
|
9058
9066
|
"favorite": { "type": "boolean" },
|
|
9059
|
-
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9060
9067
|
"fileName": { "type": "string" },
|
|
9068
|
+
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9061
9069
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
9062
9070
|
},
|
|
9063
9071
|
"required": [
|
|
@@ -9371,9 +9379,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9371
9379
|
"const": "image"
|
|
9372
9380
|
},
|
|
9373
9381
|
"favorite": { "type": "boolean" },
|
|
9382
|
+
"fileName": { "type": "string" },
|
|
9374
9383
|
"sourcePath": { "type": "string" },
|
|
9375
9384
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9376
|
-
"fileName": { "type": "string" },
|
|
9377
9385
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
9378
9386
|
},
|
|
9379
9387
|
"required": [
|
|
@@ -9403,9 +9411,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9403
9411
|
"const": "movieClip"
|
|
9404
9412
|
},
|
|
9405
9413
|
"favorite": { "type": "boolean" },
|
|
9414
|
+
"fileName": { "type": "string" },
|
|
9406
9415
|
"sourcePath": { "type": "string" },
|
|
9407
9416
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9408
|
-
"fileName": { "type": "string" },
|
|
9409
9417
|
"dimensions": { "$ref": "#/$defs/UamDimensions_78dd3aa7d8" }
|
|
9410
9418
|
},
|
|
9411
9419
|
"required": [
|
|
@@ -9441,9 +9449,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
9441
9449
|
"dragonBones"
|
|
9442
9450
|
] },
|
|
9443
9451
|
"favorite": { "type": "boolean" },
|
|
9452
|
+
"fileName": { "type": "string" },
|
|
9444
9453
|
"sourcePath": { "type": "string" },
|
|
9445
9454
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618" },
|
|
9446
|
-
"fileName": { "type": "string" },
|
|
9447
9455
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846" }
|
|
9448
9456
|
},
|
|
9449
9457
|
"required": [
|
|
@@ -12126,6 +12134,8 @@ const CONTRACT_SNAPSHOT = {
|
|
|
12126
12134
|
},
|
|
12127
12135
|
"resource": { "$ref": "#/$defs/UamResourceRef_3486136f6c_read" },
|
|
12128
12136
|
"controllerOverrides": { "type": "string" },
|
|
12137
|
+
"pageController": { "type": "string" },
|
|
12138
|
+
"fileName": { "type": "string" },
|
|
12129
12139
|
"instanceProperties": { "$ref": "#/$defs/Shape_8a3021d271_read" },
|
|
12130
12140
|
"propertyOverrides": { "$ref": "#/$defs/Array_7c27bc0bce_read" },
|
|
12131
12141
|
"group": { "type": "string" },
|
|
@@ -13157,6 +13167,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13157
13167
|
"titleFontSize": { "type": "number" },
|
|
13158
13168
|
"sound": { "type": "string" },
|
|
13159
13169
|
"soundVolumeScale": { "type": "number" },
|
|
13170
|
+
"pageController": { "type": "string" },
|
|
13160
13171
|
"src": { "type": "string" },
|
|
13161
13172
|
"packageId": { "type": "string" },
|
|
13162
13173
|
"group": { "type": "string" },
|
|
@@ -13246,6 +13257,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13246
13257
|
"titleFontSize": { "type": "number" },
|
|
13247
13258
|
"sound": { "type": "string" },
|
|
13248
13259
|
"soundVolumeScale": { "type": "number" },
|
|
13260
|
+
"pageController": { "type": "string" },
|
|
13249
13261
|
"src": { "type": "string" },
|
|
13250
13262
|
"packageId": { "type": "string" },
|
|
13251
13263
|
"group": { "type": "string" },
|
|
@@ -13336,6 +13348,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13336
13348
|
"titleFontSize": { "type": "number" },
|
|
13337
13349
|
"sound": { "type": "string" },
|
|
13338
13350
|
"soundVolumeScale": { "type": "number" },
|
|
13351
|
+
"pageController": { "type": "string" },
|
|
13339
13352
|
"src": { "type": "string" },
|
|
13340
13353
|
"packageId": { "type": "string" },
|
|
13341
13354
|
"group": { "type": "string" },
|
|
@@ -13427,6 +13440,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13427
13440
|
"reverse": { "type": "boolean" },
|
|
13428
13441
|
"sound": { "type": "string" },
|
|
13429
13442
|
"soundVolumeScale": { "type": "number" },
|
|
13443
|
+
"pageController": { "type": "string" },
|
|
13430
13444
|
"src": { "type": "string" },
|
|
13431
13445
|
"packageId": { "type": "string" },
|
|
13432
13446
|
"group": { "type": "string" },
|
|
@@ -13511,6 +13525,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13511
13525
|
"max": { "type": "number" },
|
|
13512
13526
|
"value": { "type": "number" },
|
|
13513
13527
|
"wholeNumbers": { "type": "boolean" },
|
|
13528
|
+
"pageController": { "type": "string" },
|
|
13514
13529
|
"src": { "type": "string" },
|
|
13515
13530
|
"packageId": { "type": "string" },
|
|
13516
13531
|
"group": { "type": "string" },
|
|
@@ -13589,6 +13604,7 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13589
13604
|
"const": "scrollBar"
|
|
13590
13605
|
},
|
|
13591
13606
|
"fixedGripSize": { "type": "boolean" },
|
|
13607
|
+
"pageController": { "type": "string" },
|
|
13592
13608
|
"src": { "type": "string" },
|
|
13593
13609
|
"packageId": { "type": "string" },
|
|
13594
13610
|
"group": { "type": "string" },
|
|
@@ -13828,9 +13844,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13828
13844
|
"const": "image"
|
|
13829
13845
|
},
|
|
13830
13846
|
"favorite": { "type": "boolean" },
|
|
13847
|
+
"fileName": { "type": "string" },
|
|
13831
13848
|
"sourcePath": { "type": "string" },
|
|
13832
13849
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618_read" },
|
|
13833
|
-
"fileName": { "type": "string" },
|
|
13834
13850
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846_read" },
|
|
13835
13851
|
"sourceBytes": { "not": {} }
|
|
13836
13852
|
},
|
|
@@ -13899,9 +13915,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13899
13915
|
"const": "movieClip"
|
|
13900
13916
|
},
|
|
13901
13917
|
"favorite": { "type": "boolean" },
|
|
13918
|
+
"fileName": { "type": "string" },
|
|
13902
13919
|
"sourcePath": { "type": "string" },
|
|
13903
13920
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618_read" },
|
|
13904
|
-
"fileName": { "type": "string" },
|
|
13905
13921
|
"dimensions": { "$ref": "#/$defs/UamDimensions_78dd3aa7d8_read" },
|
|
13906
13922
|
"sourceBytes": { "not": {} }
|
|
13907
13923
|
},
|
|
@@ -13980,9 +13996,9 @@ const CONTRACT_SNAPSHOT = {
|
|
|
13980
13996
|
"dragonBones"
|
|
13981
13997
|
] },
|
|
13982
13998
|
"favorite": { "type": "boolean" },
|
|
13999
|
+
"fileName": { "type": "string" },
|
|
13983
14000
|
"sourcePath": { "type": "string" },
|
|
13984
14001
|
"branchItemIds": { "$ref": "#/$defs/Array_5444db1618_read" },
|
|
13985
|
-
"fileName": { "type": "string" },
|
|
13986
14002
|
"dimensions": { "$ref": "#/$defs/Shape_348b454846_read" },
|
|
13987
14003
|
"sourceBytes": { "not": {} }
|
|
13988
14004
|
},
|
|
@@ -16094,16 +16110,16 @@ const CONTRACT_SNAPSHOT = {
|
|
|
16094
16110
|
}
|
|
16095
16111
|
}
|
|
16096
16112
|
],
|
|
16097
|
-
"digest": "
|
|
16113
|
+
"digest": "5718c7534651570432e9dda5a5cda367cbc292e71e59f5f6ad2e1c55321dee5a"
|
|
16098
16114
|
};
|
|
16099
16115
|
//#endregion
|
|
16100
16116
|
//#region src/generated/docs.ts
|
|
16101
16117
|
const INSTALLED_DOCS = {
|
|
16102
16118
|
"version": {
|
|
16103
16119
|
"packageName": "@openfairygui/backend",
|
|
16104
|
-
"packageVersion": "0.6.
|
|
16120
|
+
"packageVersion": "0.6.3",
|
|
16105
16121
|
"nodeEngine": ">=22",
|
|
16106
|
-
"documentationDigest": "
|
|
16122
|
+
"documentationDigest": "08afcb7b44b538e1592058f3e20e94c276b86573858962f1b6591cd34ac74b39"
|
|
16107
16123
|
},
|
|
16108
16124
|
"workflow": "# Installed OpenFairyGUI workflow\n\nThis is a minimal offline companion, not the full website. Read `ofgui docs ls --json` for the installed package version, contract version, capability schema version and digest. Use the project's installed `ofgui`/`ofgui-mcp`, not a global executable or an online latest-version lookup. A mismatched installation must be reconciled by the host before editing.\n\n## Discover the current contract\n\n- `ofgui docs find \"selector\" --json` searches this installed corpus.\n- `ofgui docs cat contracts --json` lists Core operations and Backend/MCP mappings.\n- `ofgui docs schema setDisplayNodeProps --json` reads one self-contained operation schema.\n- `ofgui docs schema cli/validate --json` reads the installed CLI output schema; `cli/docs cat` is a valid exact document ID for the nested command.\n- `ofgui docs cat methods/queryEntity --json` reads precise input/output wire schemas.\n- `ofgui docs diagnostic stale_write --json` reads recovery guidance.\n- MCP `resources/read` at `openfairygui://docs/index` provides the same index and content URIs. MCP is local stdio, not an assumed HTTP port.\n\nThe generated schemas describe JSON wire structure and input budgets, not semantic validity. Native SDK byte fields remain Uint8Array; MCP transports declared byte fields as integer arrays. Arbitrary extension data is not converted. Host objects/functions are omitted from MCP wire schemas; use SDK declarations for host injection, not guessed JSON fields.\n\nMCP allows up to 8 MiB of aggregate byte input at generated byte paths, without applying the general 10000-element array or per-byte node limits. Arbitrary metadata retains general limits. All value-bearing Gear defaults may be null, preserving the owner's initial state when no default override exists; component-instance controllerOverrides retains controller selections.\n\nAll CLI JSON uses `{schemaVersion:1,command,success:true,result}` or `{schemaVersion:1,command,success:false,error:{code,message},result?}`. Documentation version/index/body fields are inside `result`; read `result.text` for document content. Invalid/incomplete validate and doctor responses retain their full report under `result`. Help/version are text; other JSON-mode stdout contains exactly one document and human logs use stderr. Exit codes: 0 success, 1 workflow failure, 2 arguments, 3 incomplete validation. CLI owns envelopes, not new workflow semantics.\n\n## Edit safely\n\n1. Read capabilities. Existing projects use openSession (with host authorization and a lifetime lock); openProjectSession accepts a host-supplied authoritative UAM, not a shortcut around lossy file-session guards.\n2. Read getProjectOutline to discover exact identities, then queryEntity for the relevant current properties and actual revision. Capabilities list the supported read.entityQuery.kinds: project, package, resource, component, displayNode, controller and transition. Project queries use target {kind:\"project\"} without a selector; package queries use {kind:\"package\",selector:{packageId}}. Both return identity and complete entity.properties.settings. Controllers use packageId + componentResourceId + controllerName; transitions use packageId + componentResourceId + transitionName. Names are exact and component-scoped; duplicates fail as ambiguous. Controller snapshots include pages/actions; transition snapshots include items. Gears are already included in displayNode snapshots. Fixed projections exclude source bytes; budget failures require host inspection.\n3. Read the operation and method schemas. Plan the smallest authorized batch using current identifiers and expectedRevision.\n4. preflightTransaction executes on an isolated snapshot and discards it. Inspect projectedRevision, impact.entities (exact identities and changed fields, including reference normalization), impact.files (ProjectWriter model diff, not a disk write plan) and persistence.nextAction. The diff starts at the current revision, not the last save. It contains no source bytes. Summary overflow or serialization failure returns transaction_preview_failed without a partial result. No revision is reserved; writeVerified is always false. It does not save files or guarantee later apply/save/publish.\n5. Only when authorized, applyTransaction with the planned batch and expectedRevision. On stale_write, refresh and replan; never blindly substitute a newer revision.\n6. validateSession checks the new authoritative state. A successful response can contain an invalid or incomplete validation report; require status valid and complete true before treating validation as passed.\n7. When authorized, saveSession checks revision independently and writes the original project only. Keep path policy, UAM fidelity and rollback guards. Close the session only after handling unsaved changes. Read saved output again when disk round-trip is part of acceptance.\n\nPreview permits invalid references in the existing snapshot so a repair can be reviewed, but serializes that snapshot only into memory. The projected state and all persistence remain validated; unsupported or unrepresentable snapshots still fail explicitly.\n\nupdateProjectSettings and updatePackageSettings replace complete settings snapshots. Copy the corresponding query's entity.properties.settings, change only requested fields, retain other nested settings and optional fields, and submit the complete settings with the queried revision. Package updates also require the original packageId selector. Settings queries share the same response budgets as other entity kinds.\n\nupdateController and updateTransition replace complete snapshots, not partial patches. Copy the queried entity.properties, change only the requested fields, preserve page IDs/remarks/actions, item order/targets, settings and references, and submit the original selector with the queried revision. A stale_write requires refreshing and replanning the full snapshot for all these replacement operations. Querying does not validate references or grant permission to edit them.\n\n## Consume the committed session state\n\nFor complete public UAM consumption, use readSessionState({sessionId, expectedRevision?}); use queryEntity for targeted properties. The detached model excludes only asset resources' primary sourceBytes, retaining sourcePath and JSON extensions. It includes revision, dirty, lastSavedRevision, readComplete, readDiagnostics and uamFidelity. Only this read-model output schema accepts unnamed object fields; transaction input contracts remain unchanged.\n\nRead each asset with readResourceBytes({sessionId, expectedRevision: state.revision, selector:{packageId,resourceId}}). Bytes are detached Uint8Array values in the SDK and integer arrays in MCP, limited to the primary file already held in memory. There is no disk hydration or auxiliary-file discovery. Components are unsupported; unavailable bytes produce session_read_failed with reason bytes_unavailable.\n\nOn stale_read, discard the incomplete model/bytes collection and restart from readSessionState. Reads do not wait for uncommitted transactions, retain historical versions, or reserve revisions. Saving can update sourcePath and dirty without increasing the edit revision; the same revision does not identify permanently identical complete UAM. Completeness/fidelity flags preserve existing meaning and do not guarantee bytes, rendering or saving. Preserve failed reads as failures; never save or repair merely to obtain a read.\n\nCapabilities advertise a 4 MiB compact JSON data limit (depth 64, 500000 nodes) for the model and 1 MiB per primary resource. Both new MCP tools additionally limit the complete JSON CallToolResult, including compact text and structuredContent, to 16 MiB; excess returns mcp_response_budget_exceeded. Native model/buffer overflow returns session_read_failed with reason response_budget_exceeded, without truncation. Read the installed methods/readSessionState and methods/readResourceBytes schemas for precise inputs, results and errors.\n\n## Diagnose without repair\n\n`ofgui doctor --json` checks installed CLI/documentation versions, the Node Backend capability snapshot, in-memory Sharp PNG/JPEG encoding and pixel decoding, and temporary-directory access flags. `ofgui doctor <project-directory-or-fairy-file> --json` additionally runs existing Node project validation, including source reads and available image decoding. Optional `--output-dir <directory>` checks an explicit destination or its nearest existing ancestor, without creating it. Directory checks return the absolute requested `path`, link-resolved `inspectedPath` and `exists` (null when unknown); files, dangling links and access errors fail. The temporary directory must exist. It opens no Backend session, creates no lock, installs nothing, writes no probe files and changes no configuration.\n\nExit 0 means the requested checks completed; exit 1 means a detected error; exit 2 means invalid arguments; exit 3 means native image capability is unavailable/failed or project validation is incomplete. Inspect result.checks, result.errors and result.project. Without a project, its source bytes are not checked. Access flags do not prove effective ACL permissions, available space, later writes/rename/rollback or continued access. The capability manifest remains a declaration; a successful doctor does not prove publish/restore or runtime rendering. Plugins and configured output destinations are not executed or checked automatically; only explicit --output-dir is inspected. This product doctor does not inspect Git, pnpm, repository builds or fixture submodules; maintainers use pnpm repo:doctor for those.\n\nRead diagnostic guides for ownership and recovery boundaries. Every formal Core/Backend diagnostic code is covered; shared codes list all `owners`, while response `owner` identifies the actual source. Missing bytes/decoders, rejected paths and expired sessions require host action; do not invent repair/hydration tools, widen roots, discard unsaved work, or turn incomplete validation into success. Invalid/unsupported operations require schema-based replanning, live locks cannot be removed, and write failures require preserving dirty state and inspecting actual files.\n\n## Publish and recover trusted local artifacts\n\nPublishing and restoration are external Node-hosted workflows, not Backend session methods or general MCP editing tools. The host must authorize input and output directories independently. They require the native image capability; do not rename binary extensions to imitate a different target profile.\n\n- `ofgui publish <project> --output <release-directory> --project-type layabox --json` publishes the current saved project. `--output` overrides runtime artifact destinations; configured code generation still uses its own destinations and project plugins run as trusted local code.\n- The JSON document is `{schemaVersion:1,command:\"publish\",success:true,result:{files:[{path,size}]}}`. Paths are final absolute paths and sizes are bytes. The Node SDK `publishNode()` returns the same `result`. The manifest records actual successful filesystem/atlas writes, including code written through the supplied publish filesystem; it excludes pre-existing untouched files, deletions and arbitrary plugin I/O outside that filesystem. It is not an inventory of everything in the output directory. Explicit runtime output is staged and rolled back on failure; separately configured code outputs and arbitrary plugin effects are not covered by that directory transaction.\n- `ofgui restore <trusted-release-directory> --output <separate-project-directory> --project-type layabox --json` returns `{schemaVersion:1,command:\"restore\",success:true,result:{projectPath,packages:[{id,name}],warnings:[]}}`. Warnings are not a validation pass. Reread the returned projectPath and run `ofgui validate <projectPath> --json`; require valid and complete validation.\n- Both artifact commands exit 0 on workflow success, 1 on workflow failure, and 2 on command syntax errors. Errors are `{schemaVersion:1,command,success:false,error:{code,message}}`, with `publish_failed`, `restore_failed` or `invalid_arguments`. In JSON mode stdout contains only this document; human/plugin output goes to stderr. Help remains human-readable. Errors do not include a claimed successful file manifest.\n- Restore requires a separate directory, not a `.fairy` file. Do not force overwrite by default. `--force` replaces an existing nonempty target only after complete staged recovery; parse/image failures retain the previous target. Only trusted local artifacts are supported, not arbitrary third-party imports.\n- Read `ofgui docs cat restore-limits --json` or MCP resource `openfairygui://docs/restore-limits` for the installed version's full recovery boundary. Accept readable, structurally valid supported semantics and decoded assets, not original project IDs, workspace state, unpublished resources, original filenames/extensions, controller editor selection/export flags, float32 text precision or byte-identical XML.\n",
|
|
16109
16125
|
"restoreLimits": "# 受限发布产物恢复边界\n\n`restore` 只是一条受限的本地故障恢复路径,不是 FairyGUI 的常规创作入口、第三方发布物导入器或源码还原承诺。本文档记录其安全使用范围,以及当前仓库已经验证过、无法仅凭发布产物稳定恢复的内容。\n\n## 使用范围与安全边界\n\n| 项目 | 当前口径 |\n|---|---|\n| 输入 | 仅处理可信的本地发布目录;不把未知来源 `.fui` / `_fui.bytes` 视为安全输入 |\n| 输出 | 必须是独立工程目录,不接受 `.fairy` 单文件目标 |\n| 路径约束 | 拒绝资源路径、包名、分支名、文件名中的路径逃逸;发布目录内资源若解析到输入目录外也会失败 |\n| 覆盖行为 | 先在相邻暂存目录完成工程和资源写入,再替换目标;`--force` 不会在二进制解析或资源重建前删除旧输出 |\n| 不代表 | 不是恶意文件检测器,也不保证第三方产物能够安全或完整恢复 |\n\n这里的“不可还原”指:\n\n| 项目 | 含义 |\n|---|---|\n| 输入范围 | 仅使用发布目录中的 `.fui` / `_fui.bytes`、图集 PNG、以及同目录 loose 资源 |\n| 判定标准 | 不能稳定、通用、无外部辅助地恢复回原工程语义或原始 XML 文本 |\n| 不包含 | 仍可通过补协议、补 writer 规则、补测试继续收敛的普通实现问题 |\n\n## 总结\n\n| 结论 | 说明 |\n|---|---|\n| 受限恢复目标 | 在可信输入下生成一个可重读、可打开、结构自洽的 FairyGUI 工程 |\n| 不保证目标 | 还原成与原工程逐字节一致的源码工程 |\n| 主要原因 | 发布产物会丢失一部分编辑器阶段信息,或把原始值降精度到运行时格式 |\n\n## 当前已确认的不可还原项\n\n恢复时推导出的图片尺寸用于资源重建,但不作为原始声明尺寸写入 `package.xml`;生成的字体纹理和字形图片按顺序跟随对应字体。`RestoreResult.document` 保留尺寸省略与资源排序两种写入提示,交给新的 `ProjectWriter` 或 `NodeIO.writeProject()` 仍生效。提示属于内存中的序列化控制,不随 UAM 转换或重新读取传播。`ProjectWriter.setImageWriteHints(image, {})` 清除该图片的全部提示,恢复普通尺寸写回和资源排序;需要保留排序时,设置 `{ packageOrder: { afterId, weight } }`,其中目标是同包、同分支且未设置排序提示的资源。\n\n### 1. 发布包中根本不存在的资源或动作\n\n发布物中缺失独立资源项的字形图像使用稳定 glyph 图像 ID 的 UTF-8 十六进制生成 `images/glyph-<id>.png`,不同字体的不同图像 ID 不会因字符相同而重名。已有资源项保留发布物中的名称和路径;生成名称不代表原始源文件名,不依据示例包名或字体名称猜测。\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 组件资源 | 原工程存在、但发布包未携带的组件 XML | 发布产物没有资源定义,restore 无法凭空生成真实内容 | `HitTest/component1.xml`、`PullToRefresh/Button1.xml`、`PullToRefresh/Button2.xml`、`TurnPage/Button3.xml` |\n| Transition item | 原工程存在、但二进制 transition block 未携带的 item | 二进制里没有对应时间轴项,无法可靠反推 | `Transition/BOSS.xml` 中 `target=\"n3\"` 的 6 个 item |\n\n说明:这类内容如果强行补出,只能生成占位内容,不能声称是“还原原工程”。\n\n### 2. 原始资源文件名与扩展名\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 普通图片资源 | 原工程使用的真实文件扩展名与双后缀命名 | 发布包只保留运行时资源名,不稳定保留工程文件名 | `change.jpg -> change.png`、`Paper.jpg -> Paper.png`、`i3.png.png -> i3.png` |\n| 部分 loose 资源 | 若发布名与工程名完全脱钩,且缺少稳定映射线索 | 发布目录只提供发布后文件名,原工程命名信息已经丢失 | 仍可能出现少量发布名残留 |\n\n说明:当前实现已经尽量把“资源 id 命名”还原回工程名,但对原始扩展名并不能做通用、可靠的反推。\n\n### 3. Transition path 的原始文本精度\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 路径字符串 | 编辑器 XML 中 path 的原始小数位数与文本格式 | 发布二进制只保存 float32 数值;写回时只能输出数值等价的字符串 | `Transition/PathDemo.xml` 的 `path` |\n\n说明:这类路径通常还能恢复到相同几何轨迹,但不能保证与原 XML 的字符串完全一致。\n\n### 4. 被降级为运行时默认值的编辑器信息\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| Transition easing | 原工程中的特定 ease 名称 | 当前样本对应二进制读出的就是默认 easing,无法证明原工程曾写过哪个非默认 ease | `Transition/BOSS.xml`、`TRAP.xml`、`GoodHit.xml` 中部分 `Expo.Out` / `Back.Out` / `Bounce.Out` |\n| 简单 Group 节点 | 仅用于编辑器分组、但没有额外运行时语义的 `GGroup` 节点 | 当前样本中的发布组件数据会直接裁掉这类 group,二进制 child list 里既没有 group 节点,也没有可稳定回推的 group 归属索引 | `Basics/Demo_Clip&Scroll.xml`、`Emoji/Main.xml`、`TurnPage/Book.xml` |\n| Group 高级模式 | 原工程 XML 中的 `group.advanced=\"true\"` | 发布 group block写出的是布局与间距等运行时数据,不单独保留编辑器里的高级模式开关;当前样本中二进制读回的 group 会直接落成 `advanced=false` | `Basics/Demo_Grid.xml`、`Transition/Main.xml`、`Transition/PowerUp.xml` |\n| Controller 当前选中页 | 原工程 XML 中的 `controller.selected` 当前页状态 | 发布 controller block稳定保存的是 `homePageType/homePage` 发布首页信息;当前样本中的二进制常写成 `default`,并不保留编辑器工程里当时的非零当前页 | `TurnPage/Main.xml` 的 `bookPos=\"2\"`、`TurnPage/Page.xml` 的 `style=\"1\"` / `side=\"1\"`、`FrontCover.xml` / `BackCover.xml` 的 `side=\"1\"` |\n| Controller 导出标记 | 原工程 XML 中的 `controller.exported=\"true\"` | 当前样本对应的 controller 发布 block只写 `name/pages/homePageType/homePage/actions`,没有独立写出 `exported` | `TurnPage/BackCover.xml`、`TurnPage/FrontCover.xml`、`TurnPage/Page.xml` |\n| 默认值显式性 | 原工程是否显式写出默认属性 | 发布包只保留语义值,不保留“这个默认值当时是否显式写在 XML 里” | 如 `xy=\"0,0\"`、空文本、默认布尔值等 |\n\n说明:这类信息恢复后通常仍然语义可用,但无法保证与原工程的编辑器写法逐项一致。\n\n### 5. 编辑器工程本地设置\n\n| 类别 | 不可还原内容 | 原因 |\n|---|---|---|\n| 工程标识 | 原始 `projectId` | restore 会生成新的工程标识 |\n| 工程设置 | 原始 `.objs` / workspace / 编辑器本地状态 | 发布目录不包含这些本地工程文件 |\n| 初始化设置之外的项目配置 | 原工程的非发布产物配置 | 当前 restore 按初始化默认值生成工程设置,而不是恢复源工程工作区状态 |\n\n说明:当前 restore 的目标是“重建可用工程”,不是恢复编辑器本地工作环境。\n\n### 6. 原工程 XML 的文本级细节\n\n| 类别 | 不可还原内容 | 原因 |\n|---|---|---|\n| 属性顺序 | 原标签属性排列顺序 | XML 语义不依赖属性顺序,发布产物也不保留该信息 |\n| 格式风格 | 换行、缩进、是否自闭合、空格风格 | 这是 writer 生成结果,不是发布产物协议内容 |\n| 大小写风格 | 某些颜色值、小数文本风格 | 发布包保留的是数值语义,不是原文本样式 |\n\n说明:当前实现会尽量贴近 FairyGUI 编辑器写法,但不会把这类文本风格视为“可从发布产物逆推出的正式数据”。\n\n## 当前恢复输出范围\n\n| 项目 | 当前口径 |\n|---|---|\n| 工程目标 | 在可信输入下生成可读、可打开、可继续编辑的 FairyGUI 工程 |\n| 资源目标 | 尽量恢复包内素材、组件 XML、字体派生图与 `.jta` / `.fnt` 等正式资源 |\n| 不承诺 | 与原工程一模一样的文件名、文本格式、局部编辑器状态 |\n\n## 何时需要外部辅助信息\n\n若目标不是“重建可用工程”,而是“尽量贴近原工程文本或命名”,则需要额外输入:\n\n| 额外输入 | 作用 |\n|---|---|\n| 原工程目录 | 作为命名、路径、缺失资源、文本样式的真实基准 |\n| 编辑器工作区文件 | 恢复 `.objs`、workspace、本地工程状态 |\n| 发布前清单或映射表 | 回填发布名与工程名之间的脱钩关系 |\n\n## 当前样本下仍然成立的判断\n\n| 判断 | 说明 |\n|---|---|\n| 可以从发布产物重建“可工作的工程” | 是 |\n| 可以从发布产物重建“原工程的源码真迹” | 否 |\n| 还原结果是否应该继续优化 | 可以,但应只优化“发布产物里确实有证据的部分” |\n",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfairygui/backend",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "FairyGUI Headless Authoring SDK — stateful backend runtime and session services.",
|
|
5
5
|
"author": "OpenFairyGUI Contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"runtime"
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@openfairygui/core": "0.6.
|
|
70
|
-
"@openfairygui/functions": "0.6.
|
|
69
|
+
"@openfairygui/core": "0.6.3",
|
|
70
|
+
"@openfairygui/functions": "0.6.3"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"ava": "^7.0.0",
|
|
@@ -5068,6 +5068,12 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
5068
5068
|
"controllerOverrides": {
|
|
5069
5069
|
"type": "string"
|
|
5070
5070
|
},
|
|
5071
|
+
"pageController": {
|
|
5072
|
+
"type": "string"
|
|
5073
|
+
},
|
|
5074
|
+
"fileName": {
|
|
5075
|
+
"type": "string"
|
|
5076
|
+
},
|
|
5071
5077
|
"instanceProperties": {
|
|
5072
5078
|
"$ref": "#/$defs/Shape_8a3021d271"
|
|
5073
5079
|
},
|
|
@@ -6881,6 +6887,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
6881
6887
|
"soundVolumeScale": {
|
|
6882
6888
|
"type": "number"
|
|
6883
6889
|
},
|
|
6890
|
+
"pageController": {
|
|
6891
|
+
"type": "string"
|
|
6892
|
+
},
|
|
6884
6893
|
"src": {
|
|
6885
6894
|
"type": "string"
|
|
6886
6895
|
},
|
|
@@ -7036,6 +7045,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
7036
7045
|
"soundVolumeScale": {
|
|
7037
7046
|
"type": "number"
|
|
7038
7047
|
},
|
|
7048
|
+
"pageController": {
|
|
7049
|
+
"type": "string"
|
|
7050
|
+
},
|
|
7039
7051
|
"src": {
|
|
7040
7052
|
"type": "string"
|
|
7041
7053
|
},
|
|
@@ -7204,6 +7216,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
7204
7216
|
"soundVolumeScale": {
|
|
7205
7217
|
"type": "number"
|
|
7206
7218
|
},
|
|
7219
|
+
"pageController": {
|
|
7220
|
+
"type": "string"
|
|
7221
|
+
},
|
|
7207
7222
|
"src": {
|
|
7208
7223
|
"type": "string"
|
|
7209
7224
|
},
|
|
@@ -7363,6 +7378,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
7363
7378
|
"soundVolumeScale": {
|
|
7364
7379
|
"type": "number"
|
|
7365
7380
|
},
|
|
7381
|
+
"pageController": {
|
|
7382
|
+
"type": "string"
|
|
7383
|
+
},
|
|
7366
7384
|
"src": {
|
|
7367
7385
|
"type": "string"
|
|
7368
7386
|
},
|
|
@@ -7511,6 +7529,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
7511
7529
|
"wholeNumbers": {
|
|
7512
7530
|
"type": "boolean"
|
|
7513
7531
|
},
|
|
7532
|
+
"pageController": {
|
|
7533
|
+
"type": "string"
|
|
7534
|
+
},
|
|
7514
7535
|
"src": {
|
|
7515
7536
|
"type": "string"
|
|
7516
7537
|
},
|
|
@@ -7645,6 +7666,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
7645
7666
|
"fixedGripSize": {
|
|
7646
7667
|
"type": "boolean"
|
|
7647
7668
|
},
|
|
7669
|
+
"pageController": {
|
|
7670
|
+
"type": "string"
|
|
7671
|
+
},
|
|
7648
7672
|
"src": {
|
|
7649
7673
|
"type": "string"
|
|
7650
7674
|
},
|
|
@@ -12752,12 +12776,12 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
12752
12776
|
"favorite": {
|
|
12753
12777
|
"type": "boolean"
|
|
12754
12778
|
},
|
|
12755
|
-
"branchItemIds": {
|
|
12756
|
-
"$ref": "#/$defs/Array_5444db1618"
|
|
12757
|
-
},
|
|
12758
12779
|
"fileName": {
|
|
12759
12780
|
"type": "string"
|
|
12760
12781
|
},
|
|
12782
|
+
"branchItemIds": {
|
|
12783
|
+
"$ref": "#/$defs/Array_5444db1618"
|
|
12784
|
+
},
|
|
12761
12785
|
"dimensions": {
|
|
12762
12786
|
"$ref": "#/$defs/Shape_348b454846"
|
|
12763
12787
|
}
|
|
@@ -12803,12 +12827,12 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
12803
12827
|
"favorite": {
|
|
12804
12828
|
"type": "boolean"
|
|
12805
12829
|
},
|
|
12806
|
-
"branchItemIds": {
|
|
12807
|
-
"$ref": "#/$defs/Array_5444db1618"
|
|
12808
|
-
},
|
|
12809
12830
|
"fileName": {
|
|
12810
12831
|
"type": "string"
|
|
12811
12832
|
},
|
|
12833
|
+
"branchItemIds": {
|
|
12834
|
+
"$ref": "#/$defs/Array_5444db1618"
|
|
12835
|
+
},
|
|
12812
12836
|
"dimensions": {
|
|
12813
12837
|
"$ref": "#/$defs/UamDimensions_78dd3aa7d8"
|
|
12814
12838
|
}
|
|
@@ -12861,12 +12885,12 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
12861
12885
|
"favorite": {
|
|
12862
12886
|
"type": "boolean"
|
|
12863
12887
|
},
|
|
12864
|
-
"branchItemIds": {
|
|
12865
|
-
"$ref": "#/$defs/Array_5444db1618"
|
|
12866
|
-
},
|
|
12867
12888
|
"fileName": {
|
|
12868
12889
|
"type": "string"
|
|
12869
12890
|
},
|
|
12891
|
+
"branchItemIds": {
|
|
12892
|
+
"$ref": "#/$defs/Array_5444db1618"
|
|
12893
|
+
},
|
|
12870
12894
|
"dimensions": {
|
|
12871
12895
|
"$ref": "#/$defs/Shape_348b454846"
|
|
12872
12896
|
}
|
|
@@ -13349,15 +13373,15 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
13349
13373
|
"favorite": {
|
|
13350
13374
|
"type": "boolean"
|
|
13351
13375
|
},
|
|
13376
|
+
"fileName": {
|
|
13377
|
+
"type": "string"
|
|
13378
|
+
},
|
|
13352
13379
|
"sourcePath": {
|
|
13353
13380
|
"type": "string"
|
|
13354
13381
|
},
|
|
13355
13382
|
"branchItemIds": {
|
|
13356
13383
|
"$ref": "#/$defs/Array_5444db1618"
|
|
13357
13384
|
},
|
|
13358
|
-
"fileName": {
|
|
13359
|
-
"type": "string"
|
|
13360
|
-
},
|
|
13361
13385
|
"dimensions": {
|
|
13362
13386
|
"$ref": "#/$defs/Shape_348b454846"
|
|
13363
13387
|
}
|
|
@@ -13403,15 +13427,15 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
13403
13427
|
"favorite": {
|
|
13404
13428
|
"type": "boolean"
|
|
13405
13429
|
},
|
|
13430
|
+
"fileName": {
|
|
13431
|
+
"type": "string"
|
|
13432
|
+
},
|
|
13406
13433
|
"sourcePath": {
|
|
13407
13434
|
"type": "string"
|
|
13408
13435
|
},
|
|
13409
13436
|
"branchItemIds": {
|
|
13410
13437
|
"$ref": "#/$defs/Array_5444db1618"
|
|
13411
13438
|
},
|
|
13412
|
-
"fileName": {
|
|
13413
|
-
"type": "string"
|
|
13414
|
-
},
|
|
13415
13439
|
"dimensions": {
|
|
13416
13440
|
"$ref": "#/$defs/UamDimensions_78dd3aa7d8"
|
|
13417
13441
|
}
|
|
@@ -13467,15 +13491,15 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
13467
13491
|
"favorite": {
|
|
13468
13492
|
"type": "boolean"
|
|
13469
13493
|
},
|
|
13494
|
+
"fileName": {
|
|
13495
|
+
"type": "string"
|
|
13496
|
+
},
|
|
13470
13497
|
"sourcePath": {
|
|
13471
13498
|
"type": "string"
|
|
13472
13499
|
},
|
|
13473
13500
|
"branchItemIds": {
|
|
13474
13501
|
"$ref": "#/$defs/Array_5444db1618"
|
|
13475
13502
|
},
|
|
13476
|
-
"fileName": {
|
|
13477
|
-
"type": "string"
|
|
13478
|
-
},
|
|
13479
13503
|
"dimensions": {
|
|
13480
13504
|
"$ref": "#/$defs/Shape_348b454846"
|
|
13481
13505
|
}
|
|
@@ -17892,6 +17916,12 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
17892
17916
|
"controllerOverrides": {
|
|
17893
17917
|
"type": "string"
|
|
17894
17918
|
},
|
|
17919
|
+
"pageController": {
|
|
17920
|
+
"type": "string"
|
|
17921
|
+
},
|
|
17922
|
+
"fileName": {
|
|
17923
|
+
"type": "string"
|
|
17924
|
+
},
|
|
17895
17925
|
"instanceProperties": {
|
|
17896
17926
|
"$ref": "#/$defs/Shape_8a3021d271_read"
|
|
17897
17927
|
},
|
|
@@ -19738,6 +19768,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
19738
19768
|
"soundVolumeScale": {
|
|
19739
19769
|
"type": "number"
|
|
19740
19770
|
},
|
|
19771
|
+
"pageController": {
|
|
19772
|
+
"type": "string"
|
|
19773
|
+
},
|
|
19741
19774
|
"src": {
|
|
19742
19775
|
"type": "string"
|
|
19743
19776
|
},
|
|
@@ -19893,6 +19926,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
19893
19926
|
"soundVolumeScale": {
|
|
19894
19927
|
"type": "number"
|
|
19895
19928
|
},
|
|
19929
|
+
"pageController": {
|
|
19930
|
+
"type": "string"
|
|
19931
|
+
},
|
|
19896
19932
|
"src": {
|
|
19897
19933
|
"type": "string"
|
|
19898
19934
|
},
|
|
@@ -20061,6 +20097,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
20061
20097
|
"soundVolumeScale": {
|
|
20062
20098
|
"type": "number"
|
|
20063
20099
|
},
|
|
20100
|
+
"pageController": {
|
|
20101
|
+
"type": "string"
|
|
20102
|
+
},
|
|
20064
20103
|
"src": {
|
|
20065
20104
|
"type": "string"
|
|
20066
20105
|
},
|
|
@@ -20220,6 +20259,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
20220
20259
|
"soundVolumeScale": {
|
|
20221
20260
|
"type": "number"
|
|
20222
20261
|
},
|
|
20262
|
+
"pageController": {
|
|
20263
|
+
"type": "string"
|
|
20264
|
+
},
|
|
20223
20265
|
"src": {
|
|
20224
20266
|
"type": "string"
|
|
20225
20267
|
},
|
|
@@ -20368,6 +20410,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
20368
20410
|
"wholeNumbers": {
|
|
20369
20411
|
"type": "boolean"
|
|
20370
20412
|
},
|
|
20413
|
+
"pageController": {
|
|
20414
|
+
"type": "string"
|
|
20415
|
+
},
|
|
20371
20416
|
"src": {
|
|
20372
20417
|
"type": "string"
|
|
20373
20418
|
},
|
|
@@ -20502,6 +20547,9 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
20502
20547
|
"fixedGripSize": {
|
|
20503
20548
|
"type": "boolean"
|
|
20504
20549
|
},
|
|
20550
|
+
"pageController": {
|
|
20551
|
+
"type": "string"
|
|
20552
|
+
},
|
|
20505
20553
|
"src": {
|
|
20506
20554
|
"type": "string"
|
|
20507
20555
|
},
|
|
@@ -20909,15 +20957,15 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
20909
20957
|
"favorite": {
|
|
20910
20958
|
"type": "boolean"
|
|
20911
20959
|
},
|
|
20960
|
+
"fileName": {
|
|
20961
|
+
"type": "string"
|
|
20962
|
+
},
|
|
20912
20963
|
"sourcePath": {
|
|
20913
20964
|
"type": "string"
|
|
20914
20965
|
},
|
|
20915
20966
|
"branchItemIds": {
|
|
20916
20967
|
"$ref": "#/$defs/Array_5444db1618_read"
|
|
20917
20968
|
},
|
|
20918
|
-
"fileName": {
|
|
20919
|
-
"type": "string"
|
|
20920
|
-
},
|
|
20921
20969
|
"dimensions": {
|
|
20922
20970
|
"$ref": "#/$defs/Shape_348b454846_read"
|
|
20923
20971
|
},
|
|
@@ -21036,15 +21084,15 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
21036
21084
|
"favorite": {
|
|
21037
21085
|
"type": "boolean"
|
|
21038
21086
|
},
|
|
21087
|
+
"fileName": {
|
|
21088
|
+
"type": "string"
|
|
21089
|
+
},
|
|
21039
21090
|
"sourcePath": {
|
|
21040
21091
|
"type": "string"
|
|
21041
21092
|
},
|
|
21042
21093
|
"branchItemIds": {
|
|
21043
21094
|
"$ref": "#/$defs/Array_5444db1618_read"
|
|
21044
21095
|
},
|
|
21045
|
-
"fileName": {
|
|
21046
|
-
"type": "string"
|
|
21047
|
-
},
|
|
21048
21096
|
"dimensions": {
|
|
21049
21097
|
"$ref": "#/$defs/UamDimensions_78dd3aa7d8_read"
|
|
21050
21098
|
},
|
|
@@ -21169,15 +21217,15 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
21169
21217
|
"favorite": {
|
|
21170
21218
|
"type": "boolean"
|
|
21171
21219
|
},
|
|
21220
|
+
"fileName": {
|
|
21221
|
+
"type": "string"
|
|
21222
|
+
},
|
|
21172
21223
|
"sourcePath": {
|
|
21173
21224
|
"type": "string"
|
|
21174
21225
|
},
|
|
21175
21226
|
"branchItemIds": {
|
|
21176
21227
|
"$ref": "#/$defs/Array_5444db1618_read"
|
|
21177
21228
|
},
|
|
21178
|
-
"fileName": {
|
|
21179
|
-
"type": "string"
|
|
21180
|
-
},
|
|
21181
21229
|
"dimensions": {
|
|
21182
21230
|
"$ref": "#/$defs/Shape_348b454846_read"
|
|
21183
21231
|
},
|
|
@@ -24155,5 +24203,5 @@ export const CONTRACT_SNAPSHOT: ContractSnapshot = {
|
|
|
24155
24203
|
}
|
|
24156
24204
|
}
|
|
24157
24205
|
],
|
|
24158
|
-
"digest": "
|
|
24206
|
+
"digest": "5718c7534651570432e9dda5a5cda367cbc292e71e59f5f6ad2e1c55321dee5a"
|
|
24159
24207
|
};
|
package/src/generated/docs.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
export const INSTALLED_DOCS = {
|
|
3
3
|
"version": {
|
|
4
4
|
"packageName": "@openfairygui/backend",
|
|
5
|
-
"packageVersion": "0.6.
|
|
5
|
+
"packageVersion": "0.6.3",
|
|
6
6
|
"nodeEngine": ">=22",
|
|
7
|
-
"documentationDigest": "
|
|
7
|
+
"documentationDigest": "08afcb7b44b538e1592058f3e20e94c276b86573858962f1b6591cd34ac74b39"
|
|
8
8
|
},
|
|
9
9
|
"workflow": "# Installed OpenFairyGUI workflow\n\nThis is a minimal offline companion, not the full website. Read `ofgui docs ls --json` for the installed package version, contract version, capability schema version and digest. Use the project's installed `ofgui`/`ofgui-mcp`, not a global executable or an online latest-version lookup. A mismatched installation must be reconciled by the host before editing.\n\n## Discover the current contract\n\n- `ofgui docs find \"selector\" --json` searches this installed corpus.\n- `ofgui docs cat contracts --json` lists Core operations and Backend/MCP mappings.\n- `ofgui docs schema setDisplayNodeProps --json` reads one self-contained operation schema.\n- `ofgui docs schema cli/validate --json` reads the installed CLI output schema; `cli/docs cat` is a valid exact document ID for the nested command.\n- `ofgui docs cat methods/queryEntity --json` reads precise input/output wire schemas.\n- `ofgui docs diagnostic stale_write --json` reads recovery guidance.\n- MCP `resources/read` at `openfairygui://docs/index` provides the same index and content URIs. MCP is local stdio, not an assumed HTTP port.\n\nThe generated schemas describe JSON wire structure and input budgets, not semantic validity. Native SDK byte fields remain Uint8Array; MCP transports declared byte fields as integer arrays. Arbitrary extension data is not converted. Host objects/functions are omitted from MCP wire schemas; use SDK declarations for host injection, not guessed JSON fields.\n\nMCP allows up to 8 MiB of aggregate byte input at generated byte paths, without applying the general 10000-element array or per-byte node limits. Arbitrary metadata retains general limits. All value-bearing Gear defaults may be null, preserving the owner's initial state when no default override exists; component-instance controllerOverrides retains controller selections.\n\nAll CLI JSON uses `{schemaVersion:1,command,success:true,result}` or `{schemaVersion:1,command,success:false,error:{code,message},result?}`. Documentation version/index/body fields are inside `result`; read `result.text` for document content. Invalid/incomplete validate and doctor responses retain their full report under `result`. Help/version are text; other JSON-mode stdout contains exactly one document and human logs use stderr. Exit codes: 0 success, 1 workflow failure, 2 arguments, 3 incomplete validation. CLI owns envelopes, not new workflow semantics.\n\n## Edit safely\n\n1. Read capabilities. Existing projects use openSession (with host authorization and a lifetime lock); openProjectSession accepts a host-supplied authoritative UAM, not a shortcut around lossy file-session guards.\n2. Read getProjectOutline to discover exact identities, then queryEntity for the relevant current properties and actual revision. Capabilities list the supported read.entityQuery.kinds: project, package, resource, component, displayNode, controller and transition. Project queries use target {kind:\"project\"} without a selector; package queries use {kind:\"package\",selector:{packageId}}. Both return identity and complete entity.properties.settings. Controllers use packageId + componentResourceId + controllerName; transitions use packageId + componentResourceId + transitionName. Names are exact and component-scoped; duplicates fail as ambiguous. Controller snapshots include pages/actions; transition snapshots include items. Gears are already included in displayNode snapshots. Fixed projections exclude source bytes; budget failures require host inspection.\n3. Read the operation and method schemas. Plan the smallest authorized batch using current identifiers and expectedRevision.\n4. preflightTransaction executes on an isolated snapshot and discards it. Inspect projectedRevision, impact.entities (exact identities and changed fields, including reference normalization), impact.files (ProjectWriter model diff, not a disk write plan) and persistence.nextAction. The diff starts at the current revision, not the last save. It contains no source bytes. Summary overflow or serialization failure returns transaction_preview_failed without a partial result. No revision is reserved; writeVerified is always false. It does not save files or guarantee later apply/save/publish.\n5. Only when authorized, applyTransaction with the planned batch and expectedRevision. On stale_write, refresh and replan; never blindly substitute a newer revision.\n6. validateSession checks the new authoritative state. A successful response can contain an invalid or incomplete validation report; require status valid and complete true before treating validation as passed.\n7. When authorized, saveSession checks revision independently and writes the original project only. Keep path policy, UAM fidelity and rollback guards. Close the session only after handling unsaved changes. Read saved output again when disk round-trip is part of acceptance.\n\nPreview permits invalid references in the existing snapshot so a repair can be reviewed, but serializes that snapshot only into memory. The projected state and all persistence remain validated; unsupported or unrepresentable snapshots still fail explicitly.\n\nupdateProjectSettings and updatePackageSettings replace complete settings snapshots. Copy the corresponding query's entity.properties.settings, change only requested fields, retain other nested settings and optional fields, and submit the complete settings with the queried revision. Package updates also require the original packageId selector. Settings queries share the same response budgets as other entity kinds.\n\nupdateController and updateTransition replace complete snapshots, not partial patches. Copy the queried entity.properties, change only the requested fields, preserve page IDs/remarks/actions, item order/targets, settings and references, and submit the original selector with the queried revision. A stale_write requires refreshing and replanning the full snapshot for all these replacement operations. Querying does not validate references or grant permission to edit them.\n\n## Consume the committed session state\n\nFor complete public UAM consumption, use readSessionState({sessionId, expectedRevision?}); use queryEntity for targeted properties. The detached model excludes only asset resources' primary sourceBytes, retaining sourcePath and JSON extensions. It includes revision, dirty, lastSavedRevision, readComplete, readDiagnostics and uamFidelity. Only this read-model output schema accepts unnamed object fields; transaction input contracts remain unchanged.\n\nRead each asset with readResourceBytes({sessionId, expectedRevision: state.revision, selector:{packageId,resourceId}}). Bytes are detached Uint8Array values in the SDK and integer arrays in MCP, limited to the primary file already held in memory. There is no disk hydration or auxiliary-file discovery. Components are unsupported; unavailable bytes produce session_read_failed with reason bytes_unavailable.\n\nOn stale_read, discard the incomplete model/bytes collection and restart from readSessionState. Reads do not wait for uncommitted transactions, retain historical versions, or reserve revisions. Saving can update sourcePath and dirty without increasing the edit revision; the same revision does not identify permanently identical complete UAM. Completeness/fidelity flags preserve existing meaning and do not guarantee bytes, rendering or saving. Preserve failed reads as failures; never save or repair merely to obtain a read.\n\nCapabilities advertise a 4 MiB compact JSON data limit (depth 64, 500000 nodes) for the model and 1 MiB per primary resource. Both new MCP tools additionally limit the complete JSON CallToolResult, including compact text and structuredContent, to 16 MiB; excess returns mcp_response_budget_exceeded. Native model/buffer overflow returns session_read_failed with reason response_budget_exceeded, without truncation. Read the installed methods/readSessionState and methods/readResourceBytes schemas for precise inputs, results and errors.\n\n## Diagnose without repair\n\n`ofgui doctor --json` checks installed CLI/documentation versions, the Node Backend capability snapshot, in-memory Sharp PNG/JPEG encoding and pixel decoding, and temporary-directory access flags. `ofgui doctor <project-directory-or-fairy-file> --json` additionally runs existing Node project validation, including source reads and available image decoding. Optional `--output-dir <directory>` checks an explicit destination or its nearest existing ancestor, without creating it. Directory checks return the absolute requested `path`, link-resolved `inspectedPath` and `exists` (null when unknown); files, dangling links and access errors fail. The temporary directory must exist. It opens no Backend session, creates no lock, installs nothing, writes no probe files and changes no configuration.\n\nExit 0 means the requested checks completed; exit 1 means a detected error; exit 2 means invalid arguments; exit 3 means native image capability is unavailable/failed or project validation is incomplete. Inspect result.checks, result.errors and result.project. Without a project, its source bytes are not checked. Access flags do not prove effective ACL permissions, available space, later writes/rename/rollback or continued access. The capability manifest remains a declaration; a successful doctor does not prove publish/restore or runtime rendering. Plugins and configured output destinations are not executed or checked automatically; only explicit --output-dir is inspected. This product doctor does not inspect Git, pnpm, repository builds or fixture submodules; maintainers use pnpm repo:doctor for those.\n\nRead diagnostic guides for ownership and recovery boundaries. Every formal Core/Backend diagnostic code is covered; shared codes list all `owners`, while response `owner` identifies the actual source. Missing bytes/decoders, rejected paths and expired sessions require host action; do not invent repair/hydration tools, widen roots, discard unsaved work, or turn incomplete validation into success. Invalid/unsupported operations require schema-based replanning, live locks cannot be removed, and write failures require preserving dirty state and inspecting actual files.\n\n## Publish and recover trusted local artifacts\n\nPublishing and restoration are external Node-hosted workflows, not Backend session methods or general MCP editing tools. The host must authorize input and output directories independently. They require the native image capability; do not rename binary extensions to imitate a different target profile.\n\n- `ofgui publish <project> --output <release-directory> --project-type layabox --json` publishes the current saved project. `--output` overrides runtime artifact destinations; configured code generation still uses its own destinations and project plugins run as trusted local code.\n- The JSON document is `{schemaVersion:1,command:\"publish\",success:true,result:{files:[{path,size}]}}`. Paths are final absolute paths and sizes are bytes. The Node SDK `publishNode()` returns the same `result`. The manifest records actual successful filesystem/atlas writes, including code written through the supplied publish filesystem; it excludes pre-existing untouched files, deletions and arbitrary plugin I/O outside that filesystem. It is not an inventory of everything in the output directory. Explicit runtime output is staged and rolled back on failure; separately configured code outputs and arbitrary plugin effects are not covered by that directory transaction.\n- `ofgui restore <trusted-release-directory> --output <separate-project-directory> --project-type layabox --json` returns `{schemaVersion:1,command:\"restore\",success:true,result:{projectPath,packages:[{id,name}],warnings:[]}}`. Warnings are not a validation pass. Reread the returned projectPath and run `ofgui validate <projectPath> --json`; require valid and complete validation.\n- Both artifact commands exit 0 on workflow success, 1 on workflow failure, and 2 on command syntax errors. Errors are `{schemaVersion:1,command,success:false,error:{code,message}}`, with `publish_failed`, `restore_failed` or `invalid_arguments`. In JSON mode stdout contains only this document; human/plugin output goes to stderr. Help remains human-readable. Errors do not include a claimed successful file manifest.\n- Restore requires a separate directory, not a `.fairy` file. Do not force overwrite by default. `--force` replaces an existing nonempty target only after complete staged recovery; parse/image failures retain the previous target. Only trusted local artifacts are supported, not arbitrary third-party imports.\n- Read `ofgui docs cat restore-limits --json` or MCP resource `openfairygui://docs/restore-limits` for the installed version's full recovery boundary. Accept readable, structurally valid supported semantics and decoded assets, not original project IDs, workspace state, unpublished resources, original filenames/extensions, controller editor selection/export flags, float32 text precision or byte-identical XML.\n",
|
|
10
10
|
"restoreLimits": "# 受限发布产物恢复边界\n\n`restore` 只是一条受限的本地故障恢复路径,不是 FairyGUI 的常规创作入口、第三方发布物导入器或源码还原承诺。本文档记录其安全使用范围,以及当前仓库已经验证过、无法仅凭发布产物稳定恢复的内容。\n\n## 使用范围与安全边界\n\n| 项目 | 当前口径 |\n|---|---|\n| 输入 | 仅处理可信的本地发布目录;不把未知来源 `.fui` / `_fui.bytes` 视为安全输入 |\n| 输出 | 必须是独立工程目录,不接受 `.fairy` 单文件目标 |\n| 路径约束 | 拒绝资源路径、包名、分支名、文件名中的路径逃逸;发布目录内资源若解析到输入目录外也会失败 |\n| 覆盖行为 | 先在相邻暂存目录完成工程和资源写入,再替换目标;`--force` 不会在二进制解析或资源重建前删除旧输出 |\n| 不代表 | 不是恶意文件检测器,也不保证第三方产物能够安全或完整恢复 |\n\n这里的“不可还原”指:\n\n| 项目 | 含义 |\n|---|---|\n| 输入范围 | 仅使用发布目录中的 `.fui` / `_fui.bytes`、图集 PNG、以及同目录 loose 资源 |\n| 判定标准 | 不能稳定、通用、无外部辅助地恢复回原工程语义或原始 XML 文本 |\n| 不包含 | 仍可通过补协议、补 writer 规则、补测试继续收敛的普通实现问题 |\n\n## 总结\n\n| 结论 | 说明 |\n|---|---|\n| 受限恢复目标 | 在可信输入下生成一个可重读、可打开、结构自洽的 FairyGUI 工程 |\n| 不保证目标 | 还原成与原工程逐字节一致的源码工程 |\n| 主要原因 | 发布产物会丢失一部分编辑器阶段信息,或把原始值降精度到运行时格式 |\n\n## 当前已确认的不可还原项\n\n恢复时推导出的图片尺寸用于资源重建,但不作为原始声明尺寸写入 `package.xml`;生成的字体纹理和字形图片按顺序跟随对应字体。`RestoreResult.document` 保留尺寸省略与资源排序两种写入提示,交给新的 `ProjectWriter` 或 `NodeIO.writeProject()` 仍生效。提示属于内存中的序列化控制,不随 UAM 转换或重新读取传播。`ProjectWriter.setImageWriteHints(image, {})` 清除该图片的全部提示,恢复普通尺寸写回和资源排序;需要保留排序时,设置 `{ packageOrder: { afterId, weight } }`,其中目标是同包、同分支且未设置排序提示的资源。\n\n### 1. 发布包中根本不存在的资源或动作\n\n发布物中缺失独立资源项的字形图像使用稳定 glyph 图像 ID 的 UTF-8 十六进制生成 `images/glyph-<id>.png`,不同字体的不同图像 ID 不会因字符相同而重名。已有资源项保留发布物中的名称和路径;生成名称不代表原始源文件名,不依据示例包名或字体名称猜测。\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 组件资源 | 原工程存在、但发布包未携带的组件 XML | 发布产物没有资源定义,restore 无法凭空生成真实内容 | `HitTest/component1.xml`、`PullToRefresh/Button1.xml`、`PullToRefresh/Button2.xml`、`TurnPage/Button3.xml` |\n| Transition item | 原工程存在、但二进制 transition block 未携带的 item | 二进制里没有对应时间轴项,无法可靠反推 | `Transition/BOSS.xml` 中 `target=\"n3\"` 的 6 个 item |\n\n说明:这类内容如果强行补出,只能生成占位内容,不能声称是“还原原工程”。\n\n### 2. 原始资源文件名与扩展名\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 普通图片资源 | 原工程使用的真实文件扩展名与双后缀命名 | 发布包只保留运行时资源名,不稳定保留工程文件名 | `change.jpg -> change.png`、`Paper.jpg -> Paper.png`、`i3.png.png -> i3.png` |\n| 部分 loose 资源 | 若发布名与工程名完全脱钩,且缺少稳定映射线索 | 发布目录只提供发布后文件名,原工程命名信息已经丢失 | 仍可能出现少量发布名残留 |\n\n说明:当前实现已经尽量把“资源 id 命名”还原回工程名,但对原始扩展名并不能做通用、可靠的反推。\n\n### 3. Transition path 的原始文本精度\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| 路径字符串 | 编辑器 XML 中 path 的原始小数位数与文本格式 | 发布二进制只保存 float32 数值;写回时只能输出数值等价的字符串 | `Transition/PathDemo.xml` 的 `path` |\n\n说明:这类路径通常还能恢复到相同几何轨迹,但不能保证与原 XML 的字符串完全一致。\n\n### 4. 被降级为运行时默认值的编辑器信息\n\n| 类别 | 不可还原内容 | 原因 | 当前样本证据 |\n|---|---|---|---|\n| Transition easing | 原工程中的特定 ease 名称 | 当前样本对应二进制读出的就是默认 easing,无法证明原工程曾写过哪个非默认 ease | `Transition/BOSS.xml`、`TRAP.xml`、`GoodHit.xml` 中部分 `Expo.Out` / `Back.Out` / `Bounce.Out` |\n| 简单 Group 节点 | 仅用于编辑器分组、但没有额外运行时语义的 `GGroup` 节点 | 当前样本中的发布组件数据会直接裁掉这类 group,二进制 child list 里既没有 group 节点,也没有可稳定回推的 group 归属索引 | `Basics/Demo_Clip&Scroll.xml`、`Emoji/Main.xml`、`TurnPage/Book.xml` |\n| Group 高级模式 | 原工程 XML 中的 `group.advanced=\"true\"` | 发布 group block写出的是布局与间距等运行时数据,不单独保留编辑器里的高级模式开关;当前样本中二进制读回的 group 会直接落成 `advanced=false` | `Basics/Demo_Grid.xml`、`Transition/Main.xml`、`Transition/PowerUp.xml` |\n| Controller 当前选中页 | 原工程 XML 中的 `controller.selected` 当前页状态 | 发布 controller block稳定保存的是 `homePageType/homePage` 发布首页信息;当前样本中的二进制常写成 `default`,并不保留编辑器工程里当时的非零当前页 | `TurnPage/Main.xml` 的 `bookPos=\"2\"`、`TurnPage/Page.xml` 的 `style=\"1\"` / `side=\"1\"`、`FrontCover.xml` / `BackCover.xml` 的 `side=\"1\"` |\n| Controller 导出标记 | 原工程 XML 中的 `controller.exported=\"true\"` | 当前样本对应的 controller 发布 block只写 `name/pages/homePageType/homePage/actions`,没有独立写出 `exported` | `TurnPage/BackCover.xml`、`TurnPage/FrontCover.xml`、`TurnPage/Page.xml` |\n| 默认值显式性 | 原工程是否显式写出默认属性 | 发布包只保留语义值,不保留“这个默认值当时是否显式写在 XML 里” | 如 `xy=\"0,0\"`、空文本、默认布尔值等 |\n\n说明:这类信息恢复后通常仍然语义可用,但无法保证与原工程的编辑器写法逐项一致。\n\n### 5. 编辑器工程本地设置\n\n| 类别 | 不可还原内容 | 原因 |\n|---|---|---|\n| 工程标识 | 原始 `projectId` | restore 会生成新的工程标识 |\n| 工程设置 | 原始 `.objs` / workspace / 编辑器本地状态 | 发布目录不包含这些本地工程文件 |\n| 初始化设置之外的项目配置 | 原工程的非发布产物配置 | 当前 restore 按初始化默认值生成工程设置,而不是恢复源工程工作区状态 |\n\n说明:当前 restore 的目标是“重建可用工程”,不是恢复编辑器本地工作环境。\n\n### 6. 原工程 XML 的文本级细节\n\n| 类别 | 不可还原内容 | 原因 |\n|---|---|---|\n| 属性顺序 | 原标签属性排列顺序 | XML 语义不依赖属性顺序,发布产物也不保留该信息 |\n| 格式风格 | 换行、缩进、是否自闭合、空格风格 | 这是 writer 生成结果,不是发布产物协议内容 |\n| 大小写风格 | 某些颜色值、小数文本风格 | 发布包保留的是数值语义,不是原文本样式 |\n\n说明:当前实现会尽量贴近 FairyGUI 编辑器写法,但不会把这类文本风格视为“可从发布产物逆推出的正式数据”。\n\n## 当前恢复输出范围\n\n| 项目 | 当前口径 |\n|---|---|\n| 工程目标 | 在可信输入下生成可读、可打开、可继续编辑的 FairyGUI 工程 |\n| 资源目标 | 尽量恢复包内素材、组件 XML、字体派生图与 `.jta` / `.fnt` 等正式资源 |\n| 不承诺 | 与原工程一模一样的文件名、文本格式、局部编辑器状态 |\n\n## 何时需要外部辅助信息\n\n若目标不是“重建可用工程”,而是“尽量贴近原工程文本或命名”,则需要额外输入:\n\n| 额外输入 | 作用 |\n|---|---|\n| 原工程目录 | 作为命名、路径、缺失资源、文本样式的真实基准 |\n| 编辑器工作区文件 | 恢复 `.objs`、workspace、本地工程状态 |\n| 发布前清单或映射表 | 回填发布名与工程名之间的脱钩关系 |\n\n## 当前样本下仍然成立的判断\n\n| 判断 | 说明 |\n|---|---|\n| 可以从发布产物重建“可工作的工程” | 是 |\n| 可以从发布产物重建“原工程的源码真迹” | 否 |\n| 还原结果是否应该继续优化 | 可以,但应只优化“发布产物里确实有证据的部分” |\n",
|