@stage5/lumine 0.2.88 → 0.2.89
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/lib/sdk.js +16 -0
- package/package.json +1 -1
- package/sdk/BUILD_SDK_INDEX.md +107 -6
package/lib/sdk.js
CHANGED
|
@@ -35,6 +35,22 @@ export const SDK_CLI_METHODS = {
|
|
|
35
35
|
"minecraft.getMyLink": { path: "api/minecraft/link", scopes: ["content:read"] },
|
|
36
36
|
"minecraft.createLinkCode": { path: "api/minecraft/link/code", scopes: ["content:write"], write: true },
|
|
37
37
|
"minecraft.unlinkMinecraft": { path: "api/minecraft/link/unlink", scopes: ["content:write"], write: true },
|
|
38
|
+
"minecraft.getDesigns": { path: "api/minecraft/designs", scopes: ["content:read"] },
|
|
39
|
+
"minecraft.getDesign": { path: "api/minecraft/design", scopes: ["content:read"] },
|
|
40
|
+
"minecraft.saveDesign": { path: "api/minecraft/designs/save", scopes: ["content:write"], write: true },
|
|
41
|
+
"minecraft.updateDesign": { path: "api/minecraft/designs/update", scopes: ["content:write"], write: true },
|
|
42
|
+
"minecraft.deleteDesign": { path: "api/minecraft/designs/delete", scopes: ["content:write"], write: true },
|
|
43
|
+
"minecraft.checkPlacement": { path: "api/minecraft/placement/check", scopes: ["content:read"] },
|
|
44
|
+
"minecraft.buildDesign": { path: "api/minecraft/placement/build", scopes: ["content:write"], write: true },
|
|
45
|
+
"minecraft.stopZero": { path: "api/minecraft/zero/stop", scopes: ["content:write"], write: true },
|
|
46
|
+
"minecraft.undoBuild": { path: "api/minecraft/zero/undo", scopes: ["content:write"], write: true },
|
|
47
|
+
"minecraft.getSnaps": { path: "api/minecraft/snaps", scopes: ["content:read"] },
|
|
48
|
+
"minecraft.getSnap": { path: "api/minecraft/snap", scopes: ["content:read"] },
|
|
49
|
+
"minecraft.deleteSnap": { path: "api/minecraft/snaps/delete", scopes: ["content:write"], write: true },
|
|
50
|
+
"minecraft.getServerLogs": { path: "api/minecraft/logs", scopes: ["content:read"] },
|
|
51
|
+
"minecraft.getArrivalPoints": { path: "api/minecraft/homes", scopes: ["content:read"] },
|
|
52
|
+
"minecraft.setArrivalPoint": { path: "api/minecraft/homes/set", scopes: ["content:write"], write: true },
|
|
53
|
+
"minecraft.clearArrivalPoint": { path: "api/minecraft/homes/clear", scopes: ["content:write"], write: true },
|
|
38
54
|
"subjects.getMySubjects": { path: "api/content/my-subjects", scopes: ["content:read"] },
|
|
39
55
|
"subjects.search": { path: "api/content/subjects/search", scopes: ["content:read"] },
|
|
40
56
|
"subjects.getSubject": { path: "api/content/subject", scopes: ["content:read"] },
|
package/package.json
CHANGED
package/sdk/BUILD_SDK_INDEX.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Build SDK Index
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.55.0
|
|
4
4
|
Updated: 2026-09-24
|
|
5
|
-
Generated: 2026-09-
|
|
5
|
+
Generated: 2026-09-24T11:41:42.326Z
|
|
6
6
|
|
|
7
7
|
## Notes
|
|
8
8
|
- This SDK is injected into Build iframes via the Build preview/runtime.
|
|
@@ -787,14 +787,14 @@ const result = await Twinkle.characters.chat({ character: 'zero', thinkingMode:
|
|
|
787
787
|
- limit is 1-50 (default 10). kind filters to helper or workshop builds.
|
|
788
788
|
- Example: const { builds } = await Twinkle.minecraft.getZeroBuilds({ limit: 10, kind: 'workshop' });
|
|
789
789
|
- async getPeople() | scopes: content:read
|
|
790
|
-
- Returns: { canManage, people: [{ uuid, name, role: 'visitor'|'member'|'builder'|'moderator',
|
|
791
|
-
- Everyone who has joined the server with their in-game
|
|
792
|
-
- Only the server owner, in an app they own, gets
|
|
790
|
+
- Returns: { canManage, people: [{ uuid, name, role: 'visitor'|'member'|'builder'|'moderator', op, online, isZero, twinkle: { userId, username } | null, ...owner: groups, banned, protected, firstSeenAt, lastSeenAt | ...others: seen: 'online'|'today'|'week'|'month'|'older'|null }], roles }
|
|
791
|
+
- Everyone who has joined the server with their in-game rank, for a player directory; the server owner also gets the full records for role management.
|
|
792
|
+
- Every viewer gets the list. Only the server owner, in an app they own, gets canManage: true with full records (groups, bans, exact first/last seen); everyone else gets canManage: false and the public view: banned players left out, and seen is a rough bucket instead of exact times. Show role controls only when canManage is true.
|
|
793
793
|
- Roles: visitor (play and chat), member (/tpa, /home, /back, may ask Zero to build), builder (member + /fly and creative/survival), moderator (builder + teleport others, CoreProtect rollback, /kick). op: true players are server operators and have every power regardless of role.
|
|
794
794
|
- protected: true players (the owner and Zero's account) can't be changed from the app. Sorted online first, then most recently seen.
|
|
795
795
|
- Not cached; call on screen open or after a change, not on a timer.
|
|
796
796
|
- twinkle is the Twinkle account linked to that player with /link, or null.
|
|
797
|
-
- Example: const { canManage, people } = await Twinkle.minecraft.getPeople();
|
|
797
|
+
- Example: const { canManage, people } = await Twinkle.minecraft.getPeople(); renderDirectory(people, { editable: canManage });
|
|
798
798
|
- async setPlayerRole({ uuid, role }) | scopes: content:write
|
|
799
799
|
- Returns: { player: { uuid, name, role, op } }
|
|
800
800
|
- Change a player's in-game role; it applies immediately, even while they are online.
|
|
@@ -845,6 +845,107 @@ const result = await Twinkle.characters.chat({ character: 'zero', thinkingMode:
|
|
|
845
845
|
- Remove one of the viewer's own linked Minecraft accounts.
|
|
846
846
|
- Only the viewer's own links; removed is false when there was nothing to remove.
|
|
847
847
|
- Example: await Twinkle.minecraft.unlinkMinecraft({ uuid: link.uuid });
|
|
848
|
+
- async getDesigns({ query } = {}) | scopes: content:read
|
|
849
|
+
- Returns: { designs: [{ id, version, name, category, summary, size: { width, height, depth }, blocks, status, author, authorUserId, visibility: 'private'|'public', previewUrl, createdAt }], access: { rank, linked, canOrder, canModerate, isOwner } | null }
|
|
850
|
+
- Zero's design library: published designs plus the viewer's own private ones.
|
|
851
|
+
- Built-in designs (redstone devices and so on) have no author and are public.
|
|
852
|
+
- previewUrl is an image set with updateDesign, or null.
|
|
853
|
+
- access says what this viewer may do: canOrder shows placement tools (builders, moderators, the owner).
|
|
854
|
+
- Example: const { designs } = await Twinkle.minecraft.getDesigns({ query: 'castle' });
|
|
855
|
+
- async getDesign({ id }) | scopes: content:read
|
|
856
|
+
- Returns: { design: { id, version, name, category, summary, size: { width, height, depth }, blocks, status, author, authorUserId, visibility: 'private'|'public', previewUrl, createdAt }, size: [w, h, d], palette: [blockState], cells: number[] }
|
|
857
|
+
- A design's blocks for a 3D preview.
|
|
858
|
+
- cells is a flat list of [x, y, z, paletteIndex] numbers; air is left out. palette entries are block states like "oak_stairs[facing=north,half=bottom]".
|
|
859
|
+
- Private designs are only returned to their designer.
|
|
860
|
+
- Example: const { size, palette, cells } = await Twinkle.minecraft.getDesign({ id: 'harbor_house' }); for (let i = 0; i < cells.length; i += 4) addCube(cells[i], cells[i + 1], cells[i + 2], palette[cells[i + 3]]);
|
|
861
|
+
- async saveDesign({ id, name, summary, category, tags, visibility, parts }) | scopes: content:write
|
|
862
|
+
- Returns: { design: { id, version, name, category, summary, size: { width, height, depth }, blocks, status, author, authorUserId, visibility: 'private'|'public', previewUrl, createdAt } }
|
|
863
|
+
- Save a design (or a new version of your design) from blueprint parts.
|
|
864
|
+
- parts use Zero's blueprint shapes: box, hollow_box, walls, floor, line, block, cylinder, sphere, gable_roof, pyramid_roof; offsets x = east, y = up, z = south; later parts override earlier ones (carve doors/windows with "air"). Up to 60,000 blocks and 96 blocks in each direction.
|
|
865
|
+
- category is building, decor, farm or path. visibility private (default) or public. Saving the same id again adds a version; only its designer can do that. Rejections come back as 400 minecraft_studio_rejected with a readable message.
|
|
866
|
+
- Who may: the server owner, and any signed-in viewer with a linked Minecraft account (Twinkle.minecraft.createLinkCode + /link); others get 403 minecraft_not_linked. Designs are private unless visibility is 'public'. Players have a limit on how many designs they keep.
|
|
867
|
+
- Example: await Twinkle.minecraft.saveDesign({ id: 'harbor_house', name: 'Harbor house', category: 'building', visibility: 'private', parts: [{ shape: 'floor', from: [0, 0, 0], to: [8, 0, 6], block: 'stone_bricks' }, { shape: 'walls', from: [0, 1, 0], to: [8, 4, 6], block: 'spruce_planks' }] });
|
|
868
|
+
- async updateDesign({ id, visibility, previewUrl, name, summary }) | scopes: content:write
|
|
869
|
+
- Returns: { design: { id, version, name, category, summary, size: { width, height, depth }, blocks, status, author, authorUserId, visibility: 'private'|'public', previewUrl, createdAt } }
|
|
870
|
+
- Publish or unpublish a design, set its preview image, or rename it.
|
|
871
|
+
- previewUrl is typically a Twinkle.files upload of a rendered preview.
|
|
872
|
+
- Who may: a design's own designer; moderators (by linked account) and the server owner may change or delete anyone's.
|
|
873
|
+
- Example: await Twinkle.minecraft.updateDesign({ id: 'harbor_house', visibility: 'public' });
|
|
874
|
+
- async deleteDesign({ id }) | scopes: content:write
|
|
875
|
+
- Returns: { deleted }
|
|
876
|
+
- Remove one of your designs from the library.
|
|
877
|
+
- Built-in designs can't be deleted.
|
|
878
|
+
- Who may: a design's own designer; moderators (by linked account) and the server owner may change or delete anyone's.
|
|
879
|
+
- Example: await Twinkle.minecraft.deleteDesign({ id: 'old_test' });
|
|
880
|
+
- async checkPlacement({ designId, world, x, z, y?, facing?: 'north'|'east'|'south'|'west' }) | scopes: content:read
|
|
881
|
+
- Returns: { check: { clear, reasons, world, facing, anchor, bounds: { min, max }, ground: { y, min, max, water }, builtBlocks, builtSamples, placedBy: [{ name, blocks }], design } }
|
|
882
|
+
- Check a building site for a design: where it would sit and whether it would touch anyone's builds.
|
|
883
|
+
- Who may: the server owner, and builders or moderators identified by their linked Minecraft account (Twinkle.minecraft.createLinkCode + /link). Others get 403 minecraft_not_linked or minecraft_rank_too_low.
|
|
884
|
+
- The footprint is centred on x/z and turned to face facing; without y it sits on the ground. clear is false when built (non-natural) blocks stand in the footprint or 3 blocks around it, the ground is very uneven, or it would leave the world; reasons explains. placedBy lists players CoreProtect recorded placing blocks there.
|
|
885
|
+
- Call on a user action (drop or rotate), not while dragging.
|
|
886
|
+
- Example: const { check } = await Twinkle.minecraft.checkPlacement({ designId: 'harbor_house', world: 'world', x: 1200, z: 700, facing: 'south' }); outline.color = check.clear ? 'green' : 'red';
|
|
887
|
+
- async buildDesign({ ...placement, force }) | scopes: content:write
|
|
888
|
+
- Returns: { jobId, check, priority }
|
|
889
|
+
- Order Zero to build a design at a site; he switches to creative and builds it before other work.
|
|
890
|
+
- Who may: the server owner, and builders or moderators identified by their linked Minecraft account (Twinkle.minecraft.createLinkCode + /link). Others get 403 minecraft_not_linked or minecraft_rank_too_low.
|
|
891
|
+
- Follow progress with getZero() (currentBuild) and getZeroBuilds().
|
|
892
|
+
- Builders: one order waiting or building at a time, published designs or their own, and orders wait in the normal queue (priority false). Moderators: up to 3 orders, ahead of other work. The owner: no limit. force (build on a site that isn't clear) is owner-only.
|
|
893
|
+
- Example: const { jobId } = await Twinkle.minecraft.buildDesign({ designId: 'harbor_house', world: 'world', x: 1200, z: 700, facing: 'south' });
|
|
894
|
+
- async stopZero() | scopes: content:write
|
|
895
|
+
- Returns: { stopped, message }
|
|
896
|
+
- Stop the build Zero is doing right now (placed blocks stay).
|
|
897
|
+
- Who may: the server owner, and builders or moderators identified by their linked Minecraft account (Twinkle.minecraft.createLinkCode + /link). Others get 403 minecraft_not_linked or minecraft_rank_too_low.
|
|
898
|
+
- Anyone may stop or undo their own builds; moderators also builders' and members' builds and Zero's own projects; the owner anything.
|
|
899
|
+
- Example: await Twinkle.minecraft.stopZero();
|
|
900
|
+
- async undoBuild({ jobId }) | scopes: content:write
|
|
901
|
+
- Returns: { undone, title, message }
|
|
902
|
+
- Undo one of Zero's builds, putting back what was there before.
|
|
903
|
+
- Who may: the server owner, and builders or moderators identified by their linked Minecraft account (Twinkle.minecraft.createLinkCode + /link). Others get 403 minecraft_not_linked or minecraft_rank_too_low.
|
|
904
|
+
- Anyone may stop or undo their own builds; moderators also builders' and members' builds and Zero's own projects; the owner anything.
|
|
905
|
+
- Example: await Twinkle.minecraft.undoBuild({ jobId });
|
|
906
|
+
- async getSnaps({ before, limit, uuid } = {}) | scopes: content:read
|
|
907
|
+
- Returns: { snaps: [{ id, takenAt, name, uuid, world, x, y, z, caption, blocks, players, twinkleUserId }] }
|
|
908
|
+
- The /snap Gallery: 3D scenes players took in game with /snap, newest first.
|
|
909
|
+
- Every viewer gets the list. before is a time in ms (the takenAt of the last snap you have) for paging; limit 1-60 (default 30); uuid filters to one player's snaps.
|
|
910
|
+
- Example: const { snaps } = await Twinkle.minecraft.getSnaps({ limit: 30 });
|
|
911
|
+
- async getSnap({ id }) | scopes: content:read
|
|
912
|
+
- Returns: { scene: { version, id, at, by, caption, origin: [x, y, z], size: [w, h, d], palette, count, blocks, light, biomes: { palette, grid }, camera: { x, y, z, yaw, pitch, fov }, world: { name, environment, time, moonPhase, storm, thunder }, players: [{ name, uuid, x, y, z, yaw, pitch, bodyYaw, pose, sneaking, self, zero, slim, skin }] } }
|
|
913
|
+
- One snap's scene, to render in 3D from where it was taken.
|
|
914
|
+
- blocks is base64 of 5 bytes per visible block: x, y, z (relative to origin) and the palette index as a big-endian uint16. palette entries are block states like oak_stairs[facing=east,half=bottom,shape=straight,waterlogged=false].
|
|
915
|
+
- light is base64 of 7 bytes per block, in the same order: the light each face receives (+x, -x, +y, -y, +z, -z) and the block's own cell, each sky << 4 | block (0-15).
|
|
916
|
+
- biomes.grid is base64 of one byte per column (x-major: index = x * depth + z) into biomes.palette (biome ids like plains, cherry_grove).
|
|
917
|
+
- camera is in world coordinates (subtract origin for scene space); yaw 0 looks toward +z (south), 90 toward -x; pitch is positive looking down. world.time is the tick of day (0 sunrise, 6000 noon, 18000 midnight).
|
|
918
|
+
- players[].skin is a data: URL of the 64x64 skin PNG when known; slim means the thin-armed model.
|
|
919
|
+
- Scenes are large (up to a few MB); fetch one at a time.
|
|
920
|
+
- Example: const { scene } = await Twinkle.minecraft.getSnap({ id });
|
|
921
|
+
- async deleteSnap({ id }) | scopes: content:write
|
|
922
|
+
- Returns: { deleted }
|
|
923
|
+
- Delete a snap from the Gallery.
|
|
924
|
+
- Who may: the player who took it (by a linked Minecraft account), moderators, and the server owner. Others get 403 minecraft_snap_forbidden.
|
|
925
|
+
- Example: await Twinkle.minecraft.deleteSnap({ id });
|
|
926
|
+
- async getArrivalPoints() | scopes: content:read
|
|
927
|
+
- Returns: { accounts: [{ uuid, name, online, world, worldLabel, points: [{ world, label, x, y, z, savedAt }] }] }
|
|
928
|
+
- The viewer's private arrival points: where the Twinkle Gate portals drop their linked Minecraft account in each world.
|
|
929
|
+
- Only the caller's own linked accounts; 400 minecraft_not_linked when none is linked.
|
|
930
|
+
- online/world tell whether setArrivalPoint can use the player's current spot right now.
|
|
931
|
+
- Example: const { accounts } = await Twinkle.minecraft.getArrivalPoints();
|
|
932
|
+
- async setArrivalPoint({ uuid } = {}) | scopes: content:write
|
|
933
|
+
- Returns: { uuid, name, world, worldLabel, points }
|
|
934
|
+
- Save where the viewer's Minecraft player is standing right now as their arrival point in that world (the Twinkle Gate portal to that world lands them there).
|
|
935
|
+
- The player must be online; the spot is their current position, never typed coordinates (so nobody can land inside places they could not walk to).
|
|
936
|
+
- 400 minecraft_arrival_rejected when not online or the spot is unsafe (no floor, no room, lava); uuid picks one of several linked accounts.
|
|
937
|
+
- Example: const { worldLabel } = await Twinkle.minecraft.setArrivalPoint();
|
|
938
|
+
- async clearArrivalPoint({ world, uuid }) | scopes: content:write
|
|
939
|
+
- Returns: { cleared, points }
|
|
940
|
+
- Remove the viewer's arrival point in a world (back to the shared arrival).
|
|
941
|
+
- world is a world id such as world, world1, world3, world_nether.
|
|
942
|
+
- Example: await Twinkle.minecraft.clearArrivalPoint({ world: 'world3' });
|
|
943
|
+
- async getServerLogs({ days, kinds, query, limit } = {}) | scopes: content:read
|
|
944
|
+
- Returns: { total, lines: [{ at, kind: 'join'|'leave'|'kick'|'command'|'warn'|'error'|'zero'|'server', level, text }] }
|
|
945
|
+
- The Minecraft server log for the server owner: joins, kicks, commands, warnings, errors and Zero's lines, newest first, IP addresses removed.
|
|
946
|
+
- Server owner only, in an app they own; everyone else gets 403 minecraft_roles_forbidden.
|
|
947
|
+
- days 1-7 (default 1); kinds any of join, leave, kick, command, warn, error, zero, server (default all); query filters by text; limit 1-1000 (default 300). Chat is not included (getChat and getChatHistory have it).
|
|
948
|
+
- Example: const { lines } = await Twinkle.minecraft.getServerLogs({ days: 2, kinds: ['kick', 'error'] });
|
|
848
949
|
|
|
849
950
|
### Twinkle.leaderboards
|
|
850
951
|
- async get({ boardKey = 'default', limit, cursor } = {}) | scopes: none
|