@vgai/live 0.5.15 → 0.5.17
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/.tsbuildinfo +1 -1
- package/dist/editor.d.ts +50 -1
- package/dist/editor.js +57 -0
- package/package.json +5 -4
- package/src/editor.ts +63 -0
package/dist/editor.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* hand-rolls a `fetch` to `/__editor/command` itself. (WO-8 removed the one
|
|
11
11
|
* exception, `applyDiff`, which was FILE mode rather than a live wire command.)
|
|
12
12
|
*/
|
|
13
|
-
import type { ActiveDocumentCapture, AnimationCaptureAction, AssetKind, AssetPreviewCapture, AssetPreviewOptions, AssetPreviewSource, EditorClient, EditorState, EditorView, HistoryStep, InspectedFieldWrite, InspectedHierarchy, InspectedInspection, PresentedEditorView, ShadingMode, ViewPreset, ViewportCapture } from '@vgai/editor-sdk';
|
|
13
|
+
import type { ActiveDocumentCapture, AnimationCaptureAction, AssetKind, AssetPreviewCapture, AssetPreviewOptions, AssetPreviewSource, EditorClient, EditorState, EditorView, HistoryStep, InspectedFieldWrite, InspectedHierarchy, InspectedInspection, OpenedDocument, PresentedEditorView, RagdollGenerationResult, ShadingMode, ViewPreset, ViewportCapture } from '@vgai/editor-sdk';
|
|
14
14
|
import { LiveEditorDocument } from './editor-document.js';
|
|
15
15
|
import { LiveGameplayRecording } from './recording.js';
|
|
16
16
|
/** `vgai show <...>`'s four sub-verbs folded into one action name — see `showPanel`. */
|
|
@@ -96,6 +96,11 @@ export declare class LiveEditor {
|
|
|
96
96
|
showPanel(name: PanelName): Promise<void>;
|
|
97
97
|
/** `kind` inferred from `path`'s extension when omitted (`inferAssetKind`) — pass it explicitly to override. */
|
|
98
98
|
openAsset(path: string, kind?: AssetKind): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Fit native Rapier bodies and joints to a rigged GLB/glTF, copy the reusable
|
|
101
|
+
* project capability, and open the generated TSX prefab's Setup story.
|
|
102
|
+
*/
|
|
103
|
+
generateRagdoll(assetPath: string): Promise<RagdollGenerationResult>;
|
|
99
104
|
/**
|
|
100
105
|
* Captures the editor's native four-view preview. A bare string is a
|
|
101
106
|
* project-relative asset path (the common case); an explicit source object
|
|
@@ -145,6 +150,9 @@ export declare class LiveEditor {
|
|
|
145
150
|
* `{position, rotation, scale}`, rotation in Euler XYZ degrees).
|
|
146
151
|
*/
|
|
147
152
|
inspect(): Promise<InspectedInspection>;
|
|
153
|
+
/** Run one verb listed by `inspect().quickActions`, through the same action
|
|
154
|
+
* the human Inspector button invokes. */
|
|
155
|
+
runAction(actionId: string): Promise<InspectedInspection>;
|
|
148
156
|
/**
|
|
149
157
|
* READ the hierarchy panel, as data — the rows a human is looking at right
|
|
150
158
|
* now, nested exactly as the panel nests them.
|
|
@@ -185,6 +193,47 @@ export declare class LiveEditor {
|
|
|
185
193
|
* it went ("live-only (not saved)" is a destination, never silence).
|
|
186
194
|
*/
|
|
187
195
|
setField(path: string, value: unknown): Promise<InspectedFieldWrite>;
|
|
196
|
+
/**
|
|
197
|
+
* REMOVE one field's authored override — the revert arrow, as a command.
|
|
198
|
+
*
|
|
199
|
+
* Reach for this instead of `setField` whenever you are UNDOING an edit that
|
|
200
|
+
* added a property the source did not carry: `setField` can only write a
|
|
201
|
+
* value, so setting the default back leaves `position={[0, 0, 0]}` in the
|
|
202
|
+
* file where there was nothing before. Only this door restores the bytes.
|
|
203
|
+
*
|
|
204
|
+
* The answer is the same `{ subject, write }` shape, awaited past the bytes.
|
|
205
|
+
* It rejects with `code: 'REMOVAL_UNAVAILABLE'` when the field is not
|
|
206
|
+
* declared removable or the lane has no removal door — which is a missing
|
|
207
|
+
* seam to report, not a removal that failed.
|
|
208
|
+
*/
|
|
209
|
+
removeField(path: string): Promise<InspectedFieldWrite>;
|
|
210
|
+
/**
|
|
211
|
+
* OPEN one piece of the game's own SCENE TABLE by id.
|
|
212
|
+
*
|
|
213
|
+
* The address space is the adapter's declaration, not a path: `status()`'s
|
|
214
|
+
* `adapter.scenes.entries` lists every id, and the same verb opens a scene, a
|
|
215
|
+
* prefab or a story state, because the table makes them siblings — they
|
|
216
|
+
* differ only in where they are instanced.
|
|
217
|
+
*
|
|
218
|
+
* With a game LIVE in this session, a scene the adapter declares reachable
|
|
219
|
+
* through the game's own scenes contract is opened by NAVIGATING the running
|
|
220
|
+
* game (its own call, not a synthetic one), and the answer carries the game's
|
|
221
|
+
* own reading back in `scene`.
|
|
222
|
+
*
|
|
223
|
+
* Rejects with a CODE, because the classes are graded differently:
|
|
224
|
+
* `SCENE_NOT_FOUND` (which names the ids that do exist),
|
|
225
|
+
* `SCENE_NOT_OPENABLE` carrying the adapter's OWN sentence about a scene it
|
|
226
|
+
* declares unreachable, `SCENE_NAVIGATION_NOT_RUNNING` for a live-only scene
|
|
227
|
+
* while nothing is running (start the game and ask again),
|
|
228
|
+
* `SCENE_CONTRACT_UNAVAILABLE` / `SCENE_NOT_IN_CONTRACT` / `SCENE_SWITCH_FAILED`
|
|
229
|
+
* from the running game's own scenes surface, `SCENE_NOT_OPENABLE_LIVE` when
|
|
230
|
+
* this session has no remount for a native swap-slot scene,
|
|
231
|
+
* `SCENE_TABLE_UNAVAILABLE` before the adapter has
|
|
232
|
+
* loaded, and `SCENE_DOCUMENT_NOT_MOUNTED` for a piece the table says is
|
|
233
|
+
* openable and this host has no document for — a missing seam to report, not
|
|
234
|
+
* a scene that refused.
|
|
235
|
+
*/
|
|
236
|
+
open(id: string): Promise<OpenedDocument>;
|
|
188
237
|
/** Undo / redo one project transaction, through the session's own history
|
|
189
238
|
* queue — the same one the keyboard shortcut drives. */
|
|
190
239
|
undo(): Promise<HistoryStep>;
|
package/dist/editor.js
CHANGED
|
@@ -194,6 +194,13 @@ export class LiveEditor {
|
|
|
194
194
|
async openAsset(path, kind) {
|
|
195
195
|
await this.#client.openAsset(path, kind ?? inferAssetKind(path));
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Fit native Rapier bodies and joints to a rigged GLB/glTF, copy the reusable
|
|
199
|
+
* project capability, and open the generated TSX prefab's Setup story.
|
|
200
|
+
*/
|
|
201
|
+
async generateRagdoll(assetPath) {
|
|
202
|
+
return this.#client.generateRagdoll(assetPath);
|
|
203
|
+
}
|
|
197
204
|
/**
|
|
198
205
|
* Captures the editor's native four-view preview. A bare string is a
|
|
199
206
|
* project-relative asset path (the common case); an explicit source object
|
|
@@ -257,6 +264,11 @@ export class LiveEditor {
|
|
|
257
264
|
async inspect() {
|
|
258
265
|
return this.#client.inspect();
|
|
259
266
|
}
|
|
267
|
+
/** Run one verb listed by `inspect().quickActions`, through the same action
|
|
268
|
+
* the human Inspector button invokes. */
|
|
269
|
+
async runAction(actionId) {
|
|
270
|
+
return this.#client.runInspectionAction(actionId);
|
|
271
|
+
}
|
|
260
272
|
/**
|
|
261
273
|
* READ the hierarchy panel, as data — the rows a human is looking at right
|
|
262
274
|
* now, nested exactly as the panel nests them.
|
|
@@ -301,6 +313,51 @@ export class LiveEditor {
|
|
|
301
313
|
async setField(path, value) {
|
|
302
314
|
return this.#client.setInspectionField(path, value);
|
|
303
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* REMOVE one field's authored override — the revert arrow, as a command.
|
|
318
|
+
*
|
|
319
|
+
* Reach for this instead of `setField` whenever you are UNDOING an edit that
|
|
320
|
+
* added a property the source did not carry: `setField` can only write a
|
|
321
|
+
* value, so setting the default back leaves `position={[0, 0, 0]}` in the
|
|
322
|
+
* file where there was nothing before. Only this door restores the bytes.
|
|
323
|
+
*
|
|
324
|
+
* The answer is the same `{ subject, write }` shape, awaited past the bytes.
|
|
325
|
+
* It rejects with `code: 'REMOVAL_UNAVAILABLE'` when the field is not
|
|
326
|
+
* declared removable or the lane has no removal door — which is a missing
|
|
327
|
+
* seam to report, not a removal that failed.
|
|
328
|
+
*/
|
|
329
|
+
async removeField(path) {
|
|
330
|
+
return this.#client.removeInspectionField(path);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* OPEN one piece of the game's own SCENE TABLE by id.
|
|
334
|
+
*
|
|
335
|
+
* The address space is the adapter's declaration, not a path: `status()`'s
|
|
336
|
+
* `adapter.scenes.entries` lists every id, and the same verb opens a scene, a
|
|
337
|
+
* prefab or a story state, because the table makes them siblings — they
|
|
338
|
+
* differ only in where they are instanced.
|
|
339
|
+
*
|
|
340
|
+
* With a game LIVE in this session, a scene the adapter declares reachable
|
|
341
|
+
* through the game's own scenes contract is opened by NAVIGATING the running
|
|
342
|
+
* game (its own call, not a synthetic one), and the answer carries the game's
|
|
343
|
+
* own reading back in `scene`.
|
|
344
|
+
*
|
|
345
|
+
* Rejects with a CODE, because the classes are graded differently:
|
|
346
|
+
* `SCENE_NOT_FOUND` (which names the ids that do exist),
|
|
347
|
+
* `SCENE_NOT_OPENABLE` carrying the adapter's OWN sentence about a scene it
|
|
348
|
+
* declares unreachable, `SCENE_NAVIGATION_NOT_RUNNING` for a live-only scene
|
|
349
|
+
* while nothing is running (start the game and ask again),
|
|
350
|
+
* `SCENE_CONTRACT_UNAVAILABLE` / `SCENE_NOT_IN_CONTRACT` / `SCENE_SWITCH_FAILED`
|
|
351
|
+
* from the running game's own scenes surface, `SCENE_NOT_OPENABLE_LIVE` when
|
|
352
|
+
* this session has no remount for a native swap-slot scene,
|
|
353
|
+
* `SCENE_TABLE_UNAVAILABLE` before the adapter has
|
|
354
|
+
* loaded, and `SCENE_DOCUMENT_NOT_MOUNTED` for a piece the table says is
|
|
355
|
+
* openable and this host has no document for — a missing seam to report, not
|
|
356
|
+
* a scene that refused.
|
|
357
|
+
*/
|
|
358
|
+
async open(id) {
|
|
359
|
+
return this.#client.open(id);
|
|
360
|
+
}
|
|
304
361
|
/** Undo / redo one project transaction, through the session's own history
|
|
305
362
|
* queue — the same one the keyboard shortcut drives. */
|
|
306
363
|
async undo() {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@vgai/live",
|
|
3
3
|
"author": "Volter AI, Inc.",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.17",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc -p tsconfig.build.json",
|
|
31
|
-
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput"
|
|
31
|
+
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
32
|
+
"prepack": "npm run build"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@vgai/editor-sdk": "0.5.
|
|
35
|
-
"@vgai/sdk": "0.5.
|
|
35
|
+
"@vgai/editor-sdk": "0.5.17",
|
|
36
|
+
"@vgai/sdk": "0.5.17"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@playwright/test": ">=1.58.2 <2"
|
package/src/editor.ts
CHANGED
|
@@ -25,7 +25,9 @@ import type {
|
|
|
25
25
|
InspectedFieldWrite,
|
|
26
26
|
InspectedHierarchy,
|
|
27
27
|
InspectedInspection,
|
|
28
|
+
OpenedDocument,
|
|
28
29
|
PresentedEditorView,
|
|
30
|
+
RagdollGenerationResult,
|
|
29
31
|
ShadingMode,
|
|
30
32
|
ViewPreset,
|
|
31
33
|
ViewportCapture,
|
|
@@ -241,6 +243,14 @@ export class LiveEditor {
|
|
|
241
243
|
await this.#client.openAsset(path, kind ?? inferAssetKind(path));
|
|
242
244
|
}
|
|
243
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Fit native Rapier bodies and joints to a rigged GLB/glTF, copy the reusable
|
|
248
|
+
* project capability, and open the generated TSX prefab's Setup story.
|
|
249
|
+
*/
|
|
250
|
+
async generateRagdoll(assetPath: string): Promise<RagdollGenerationResult> {
|
|
251
|
+
return this.#client.generateRagdoll(assetPath);
|
|
252
|
+
}
|
|
253
|
+
|
|
244
254
|
/**
|
|
245
255
|
* Captures the editor's native four-view preview. A bare string is a
|
|
246
256
|
* project-relative asset path (the common case); an explicit source object
|
|
@@ -317,6 +327,12 @@ export class LiveEditor {
|
|
|
317
327
|
return this.#client.inspect();
|
|
318
328
|
}
|
|
319
329
|
|
|
330
|
+
/** Run one verb listed by `inspect().quickActions`, through the same action
|
|
331
|
+
* the human Inspector button invokes. */
|
|
332
|
+
async runAction(actionId: string): Promise<InspectedInspection> {
|
|
333
|
+
return this.#client.runInspectionAction(actionId);
|
|
334
|
+
}
|
|
335
|
+
|
|
320
336
|
/**
|
|
321
337
|
* READ the hierarchy panel, as data — the rows a human is looking at right
|
|
322
338
|
* now, nested exactly as the panel nests them.
|
|
@@ -363,6 +379,53 @@ export class LiveEditor {
|
|
|
363
379
|
return this.#client.setInspectionField(path, value);
|
|
364
380
|
}
|
|
365
381
|
|
|
382
|
+
/**
|
|
383
|
+
* REMOVE one field's authored override — the revert arrow, as a command.
|
|
384
|
+
*
|
|
385
|
+
* Reach for this instead of `setField` whenever you are UNDOING an edit that
|
|
386
|
+
* added a property the source did not carry: `setField` can only write a
|
|
387
|
+
* value, so setting the default back leaves `position={[0, 0, 0]}` in the
|
|
388
|
+
* file where there was nothing before. Only this door restores the bytes.
|
|
389
|
+
*
|
|
390
|
+
* The answer is the same `{ subject, write }` shape, awaited past the bytes.
|
|
391
|
+
* It rejects with `code: 'REMOVAL_UNAVAILABLE'` when the field is not
|
|
392
|
+
* declared removable or the lane has no removal door — which is a missing
|
|
393
|
+
* seam to report, not a removal that failed.
|
|
394
|
+
*/
|
|
395
|
+
async removeField(path: string): Promise<InspectedFieldWrite> {
|
|
396
|
+
return this.#client.removeInspectionField(path);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* OPEN one piece of the game's own SCENE TABLE by id.
|
|
401
|
+
*
|
|
402
|
+
* The address space is the adapter's declaration, not a path: `status()`'s
|
|
403
|
+
* `adapter.scenes.entries` lists every id, and the same verb opens a scene, a
|
|
404
|
+
* prefab or a story state, because the table makes them siblings — they
|
|
405
|
+
* differ only in where they are instanced.
|
|
406
|
+
*
|
|
407
|
+
* With a game LIVE in this session, a scene the adapter declares reachable
|
|
408
|
+
* through the game's own scenes contract is opened by NAVIGATING the running
|
|
409
|
+
* game (its own call, not a synthetic one), and the answer carries the game's
|
|
410
|
+
* own reading back in `scene`.
|
|
411
|
+
*
|
|
412
|
+
* Rejects with a CODE, because the classes are graded differently:
|
|
413
|
+
* `SCENE_NOT_FOUND` (which names the ids that do exist),
|
|
414
|
+
* `SCENE_NOT_OPENABLE` carrying the adapter's OWN sentence about a scene it
|
|
415
|
+
* declares unreachable, `SCENE_NAVIGATION_NOT_RUNNING` for a live-only scene
|
|
416
|
+
* while nothing is running (start the game and ask again),
|
|
417
|
+
* `SCENE_CONTRACT_UNAVAILABLE` / `SCENE_NOT_IN_CONTRACT` / `SCENE_SWITCH_FAILED`
|
|
418
|
+
* from the running game's own scenes surface, `SCENE_NOT_OPENABLE_LIVE` when
|
|
419
|
+
* this session has no remount for a native swap-slot scene,
|
|
420
|
+
* `SCENE_TABLE_UNAVAILABLE` before the adapter has
|
|
421
|
+
* loaded, and `SCENE_DOCUMENT_NOT_MOUNTED` for a piece the table says is
|
|
422
|
+
* openable and this host has no document for — a missing seam to report, not
|
|
423
|
+
* a scene that refused.
|
|
424
|
+
*/
|
|
425
|
+
async open(id: string): Promise<OpenedDocument> {
|
|
426
|
+
return this.#client.open(id);
|
|
427
|
+
}
|
|
428
|
+
|
|
366
429
|
/** Undo / redo one project transaction, through the session's own history
|
|
367
430
|
* queue — the same one the keyboard shortcut drives. */
|
|
368
431
|
async undo(): Promise<HistoryStep> {
|