@stage5/lumine 0.3.5 → 0.3.6
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 +10 -0
- package/package.json +1 -1
- package/sdk/BUILD_SDK_INDEX.md +18 -2
package/lib/sdk.js
CHANGED
|
@@ -214,6 +214,16 @@ export const SDK_CLI_METHODS = {
|
|
|
214
214
|
scopes: ["rewards:claim"], readOnly: true,
|
|
215
215
|
mapArgs: (args) => ({ ruleId: args.ruleId, cursor: args.cursor, limit: args.limit }),
|
|
216
216
|
},
|
|
217
|
+
"rewards.interpretAnswer": {
|
|
218
|
+
path: "api/rewards/interpret-answer", special: "rewards", operation: "interpret-answer",
|
|
219
|
+
scopes: ["rewards:claim"], readOnly: true,
|
|
220
|
+
mapArgs: (args) => ({ challengeId: args.challengeId, text: args.text }),
|
|
221
|
+
},
|
|
222
|
+
"rewards.getChallengeBoard": {
|
|
223
|
+
path: "api/rewards/challenge-board", special: "rewards", operation: "challenge-board",
|
|
224
|
+
scopes: ["rewards:claim"], readOnly: true,
|
|
225
|
+
mapArgs: () => ({}),
|
|
226
|
+
},
|
|
217
227
|
"rewards.getArchivedProblem": {
|
|
218
228
|
path: "api/rewards/archived-problem", special: "rewards", operation: "archived-problem",
|
|
219
229
|
scopes: ["rewards:claim"], readOnly: true,
|
package/package.json
CHANGED
package/sdk/BUILD_SDK_INDEX.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Version: 1.63.0
|
|
4
4
|
Updated: 2026-09-28
|
|
5
|
-
Generated: 2026-
|
|
5
|
+
Generated: 2026-10-03T04:47:01.454Z
|
|
6
6
|
|
|
7
7
|
## Notes
|
|
8
8
|
- This SDK is injected into Build iframes via the Build preview/runtime.
|
|
@@ -81,8 +81,9 @@ files:read, media:read, media:write, live:read, live:write, user:read, users:rea
|
|
|
81
81
|
|
|
82
82
|
### Twinkle.viewer
|
|
83
83
|
- async get() | scopes: none
|
|
84
|
-
- Returns: { id, username, profilePicUrl, isLoggedIn, isOwner, isGuest }
|
|
84
|
+
- Returns: { id, username, profilePicUrl, isLoggedIn, isOwner, isGuest, ageTier }
|
|
85
85
|
- Cached; use refresh() to re-fetch.
|
|
86
|
+
- ageTier is 'kid', 'teen' or 'adult', taken from the viewer's Teenager and Adult achievements (granted once an admin approves their birthdate). Guests and viewers without either achievement are 'kid'. It is a display and default-selection hint computed by the Twinkle page; do not treat it as a server-side permission.
|
|
86
87
|
- async refresh() | scopes: none
|
|
87
88
|
- Returns: Viewer info
|
|
88
89
|
- Forces a fresh fetch from the parent.
|
|
@@ -1515,6 +1516,21 @@ world.updatePresence({ x, y, z, facing });
|
|
|
1515
1516
|
- Standings of who earned the most XP or Coins in THIS app, computed by Twinkle from its own receipts (never from anything the app submits). period 'day' is today (site day, UTC), 'week' the last 7 site days, 'all' (default) every day since approval. limit defaults to 20, max 100.
|
|
1516
1517
|
- available says which boards this app's approved rules can pay: show a Coins board only when available.coins is true (an app whose rules pay XP only has no Coins standings). me is the signed-in viewer's own standing even when they fall outside the page, or null when they earned nothing in the period.
|
|
1517
1518
|
- Drafts and previews return mode 'preview' with no entries. Use Twinkle.leaderboards for app-defined scores; use this for real XP and Coins earned.
|
|
1519
|
+
- await Twinkle.rewards.interpretAnswer({ challengeId, text }) | scopes: rewards:claim
|
|
1520
|
+
- Returns: { mode: "live" | "preview", understood: boolean, value: number | null, source: "plain" | "model" }
|
|
1521
|
+
- Read a learner's free-form answer text into the single number they meant, so they can answer in any format.
|
|
1522
|
+
- For numeric-quiz bounties. Call it only when the typed text is not already a plain number or fraction (check that locally); a plain number returns source 'plain' with no model call. Then pass the returned value to claim({ challengeId, answers: [value] }). A small model reads the text and the platform pays for it, so the learner's AI Energy is never charged.
|
|
1523
|
+
- understood: false means the text had no single clear number (several alternatives, no number, or a calculation). Tell the learner in friendly words to type just the number. This is not a wrong answer and does not use a try.
|
|
1524
|
+
- The reader is given the puzzle text only to learn the requested answer format (unit, fraction/decimal/percent, which of several numbers answers the question), never the answer key, and never calculates or converts units: it only reads what was written, and the number it returns must be one the learner actually typed. Typed expressions like 5+8 are intentionally not evaluated.
|
|
1525
|
+
- Requires an open challenge of the learner's own (build_reward_challenge_not_open, HTTP 409 otherwise). Limit: 120 characters (build_reward_answer_text_invalid, 400), rate limited to a burst of 4 then one read every 5 seconds (build_reward_throttled, 429). build_reward_answer_reader_unavailable (503) means the reader is down: ask the learner to type just the number.
|
|
1526
|
+
- Drafts and owner previews return mode 'preview' and need no open challenge.
|
|
1527
|
+
- await Twinkle.rewards.getChallengeBoard() | scopes: rewards:claim
|
|
1528
|
+
- Returns: { mode: "live", dayKey, puzzles: [{ ruleId, title, setKey, rating, solvers, failers, failures, daysStanding, status: "untouched" | "undefeated" | "defeated" }], topSolvers: [{ rank, userId, username, profilePicUrl, rating, solves, hardestSolve: { ruleId, setKey, rating } | null }], recentSolves: [{ id, userId, username, ruleId, setKey, tier: "solved" | "first-solve" | "hard-won" | "legendary", attempt, firstSolve, failersBefore, failuresBefore, daysStanding, puzzleRating, at }], me: { rating, solves, rank } | null } | { mode: "preview", puzzles: [], topSolvers: [], recentSolves: [], me: null, message }
|
|
1529
|
+
- Front-page difficulty board for until-earned quiz bounties: what is being tried and failed, who is rated highest, and the latest defeats.
|
|
1530
|
+
- Computed by Twinkle from its own receipts and attempts, never from anything the app submits. Puzzles are Elo-rated against players: a player's first miss on a puzzle is a win for the puzzle, a solve is a win for the player, and repeat misses by one player never stack.
|
|
1531
|
+
- puzzles lists today's set for each until-earned rule. status 'undefeated' means someone tried and nobody has solved it yet; show it as a standing challenge. failers is how many different players missed it; failures is total wrong answers.
|
|
1532
|
+
- tier on a recent solve says how loudly to celebrate: 'legendary' (first solve of a long-undefeated puzzle), 'hard-won', 'first-solve', or plain 'solved'. It is fixed at solve time, so it never changes later.
|
|
1533
|
+
- No questions, answers, guides or private work are ever returned. Names are the same public names the XP leaderboard shows; other players who missed a puzzle are counted, never named. Drafts and previews return mode 'preview' with empty lists.
|
|
1518
1534
|
- await Twinkle.rewards.getTimeline({ ruleId?, cursor?, limit? } = {}) | scopes: rewards:claim
|
|
1519
1535
|
- Returns: { mode: "live", dayKey, entries: [{ receiptId, ruleId, ruleTitle, setKey, title, promptPreview, dayKey, closedAt, solvedAt, solver: { userId, username }, firstSolver, xp, coins, attempt }], nextCursor } | { mode: "preview", entries: [], nextCursor: null, message }
|
|
1520
1536
|
- Browse confirmed solves of retired until-earned quiz bounties, newest first.
|