@stage5/lumine 0.2.81 → 0.2.82
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/admin.js +11 -3
- package/package.json +1 -1
- package/sdk/BUILD_SDK_INDEX.md +12 -2
- package/sdk/LUMINE_ADMIN.md +27 -0
package/lib/admin.js
CHANGED
|
@@ -174,7 +174,10 @@ export function readRewardProposalDirectory(directory) {
|
|
|
174
174
|
let bytes = 0;
|
|
175
175
|
const walk = (dir) => {
|
|
176
176
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
177
|
-
if (
|
|
177
|
+
if (
|
|
178
|
+
entry.name.startsWith(".") ||
|
|
179
|
+
REWARD_PROPOSAL_SKIPPED_DIRS.has(entry.name)
|
|
180
|
+
)
|
|
178
181
|
continue;
|
|
179
182
|
const fullPath = path.join(dir, entry.name);
|
|
180
183
|
if (entry.isSymbolicLink()) {
|
|
@@ -194,7 +197,10 @@ export function readRewardProposalDirectory(directory) {
|
|
|
194
197
|
);
|
|
195
198
|
}
|
|
196
199
|
bytes += buffer.length;
|
|
197
|
-
const relative = path
|
|
200
|
+
const relative = path
|
|
201
|
+
.relative(realRoot, fullPath)
|
|
202
|
+
.split(path.sep)
|
|
203
|
+
.join("/");
|
|
198
204
|
files.push({ path: `/${relative}`, content: buffer.toString("utf8") });
|
|
199
205
|
}
|
|
200
206
|
};
|
|
@@ -3918,7 +3924,9 @@ function printRewardReviewResult({ operation, data }) {
|
|
|
3918
3924
|
console.log(` ${file.status}: ${file.path}`);
|
|
3919
3925
|
}
|
|
3920
3926
|
if (review.status === "rejected" && review.declinedByCreator) {
|
|
3921
|
-
console.log(
|
|
3927
|
+
console.log(
|
|
3928
|
+
"The creator declined the proposed changes; the request is closed.",
|
|
3929
|
+
);
|
|
3922
3930
|
}
|
|
3923
3931
|
if (review.status === "approved" && review.publishedArtifactVersionId) {
|
|
3924
3932
|
console.log(
|
package/package.json
CHANGED
package/sdk/BUILD_SDK_INDEX.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Version: 1.45.2
|
|
4
4
|
Updated: 2026-09-14
|
|
5
|
-
Generated: 2026-09-
|
|
5
|
+
Generated: 2026-09-19T10:34:03.685Z
|
|
6
6
|
|
|
7
7
|
## Notes
|
|
8
8
|
- This SDK is injected into Build iframes via the Build preview/runtime.
|
|
@@ -36,6 +36,7 @@ Generated: 2026-09-19T04:22:12.342Z
|
|
|
36
36
|
- The creator's agent designs the rewards. Declare the economy in a project file `rewards.json` at the root: budgets (userDailyXP, userDailyCoins, optional userDailyClaims; there is no app-wide daily or lifetime budget, only what one learner can earn per day) and rules [{ id, title, xp, coins, verifier: 'numeric-quiz' | 'completion', maxAttempts?, retry?: { xpPercent, coinsPercent, paidAttempts? }, minSeconds? (completion), progression?: 'dated' | 'until-earned' (quiz) }]. Wire the matching Twinkle.rewards calls with those literal rule ids. Questions and answer keys NEVER go in project files (published source is readable by every player): quiz rules get them from the private question sheet uploaded with `lumine rewards sheet <file.json>` ({ rules: { <ruleId>: { questions?, sets? } } }); `lumine rewards check` validates both together. A review request freezes the code and proposes rewards.json merged with the sheet; the administrator reads the code, checks the amounts and whether the app is exploitable, may change any amount, and approves. Creators are kids and teens: show approval status and one Send for review action; do not ask them to fill in technical forms. Every code update that retains rewards needs a new approval before publishing. Removing the SDK automatically clears its gate. Apps read amounts, tries and sets from getStatus, never from their own file.
|
|
37
37
|
- Verifiers: 'numeric-quiz' pays for server-checked numeric answers (retry share, attempt limits, dated sets or until-earned sets that stay up until somebody earns them, after-answer guides). 'completion' pays when the app reports an activity finished — a cleared stage, a finished round — at least minSeconds after start({ ruleId }); the server checks only the elapsed time, once per learner per site day (UTC midnight), and the budgets. Call start when the activity begins and claim({ challengeId }) with no answers when it ends; keep completion amounts and userDailyXP small enough that a player scripting the calls would not matter, because nothing else is verified.
|
|
38
38
|
- Numeric quiz answers are verified on the server; client scores, privateDb state, timers and completion booleans are not verified reward evidence. Limits reset at UTC midnight. Rules are earned once per viewer per UTC day; attempt limits and retry payouts come from the approved rule. Challenges expire at the UTC day boundary. Budgets apply across release changes.
|
|
39
|
+
- Optional reward rule controls: maxLifetimeClaims caps one learner’s receipts for that rule across every day and release; completionProof: classic-tower-v1 requires a server-simulated Classic Tower finish in addition to minSeconds. These are server-enforced controls. Existing completion rules without completionProof still verify elapsed time only.
|
|
39
40
|
|
|
40
41
|
## Token Scopes
|
|
41
42
|
files:read, media:read, media:write, live:read, live:write, user:read, users:read, dailyReflections:read, content:read, content:write, sharedDb:read, sharedDb:write, privateDb:read, privateDb:write, files:write, chat:read, chat:write, notifications:read, notifications:write, notifications:emit, reminders:read, reminders:write, rewards:claim
|
|
@@ -1017,6 +1018,7 @@ world.updatePresence({ x, y, z, facing });
|
|
|
1017
1018
|
- rules[].available is false on a site day (UTC) the reviewer scheduled no questions for; show the rule as not available instead of starting it. xp/coins are the first-try amounts; retryReward is what a correct answer pays after a wrong one (equal to xp/coins unless the reviewer set a retry share). maxAttempts null means unlimited wrong answers until the site's daily reset (UTC midnight, 9:00 AM in Korea). retry.paidAttempts, when set, is the last attempt number a correct answer is still paid on: a later correct answer is recorded as solved (receipt xp 0, coins 0) and pays nothing — tell the learner before they pass it.
|
|
1018
1019
|
- challenges lists challenges this viewer already started today with their questions, so an app can resume after a reload without calling start. A question's guide (reviewer-approved JSON teaching content: explanation, interactive-model configuration) is present only once the viewer has answered at least once, right or wrong; render it as the after-attempt lesson. claimsToday against userDailyClaims (null = uncapped) tells whether another bounty can still pay today.
|
|
1019
1020
|
- Under progression 'until-earned' the same set stays up day after day until somebody earns it; setKey names the set currently up. Completion rules are always available and have questionCount 0.
|
|
1021
|
+
- Rules may set maxLifetimeClaims, a per-learner limit for that rule across days and releases. rules[].lifetime contains the server-confirmed limit and remaining claims. App storage never enforces this limit.
|
|
1020
1022
|
- await Twinkle.rewards.getReceipt({ challengeId }) | scopes: rewards:claim
|
|
1021
1023
|
- Returns: { mode: "live", status: "awarded" | "pending" | "expired" | "not_found", receipt: { id, challengeId, ruleId, reviewId, artifactVersionId, dayKey, xp, coins, attempt, createdAt } | null, balances: { xp, coins } } | { mode: "preview", status: "not_found", receipt: null, message }
|
|
1022
1024
|
- Read an existing receipt for this app and signed-in viewer by server-issued challengeId, including previous UTC days and previous approved versions. Requires the current approved published release and runtime grant; a stale frame must reload first. Never awards, retries a claim, returns answer keys, or restores removed rewards permission.
|
|
@@ -1026,12 +1028,20 @@ world.updatePresence({ x, y, z, facing });
|
|
|
1026
1028
|
- Creates or resumes a server-issued challenge for the signed-in viewer. Render its questions (prompt and optional hint) and collect numeric answers in the same order. One daily challenge per rule/review; repeat starts cannot reset attempts. A challenge stays open until the site's daily reset (UTC midnight, 9:00 AM in Korea) (expiresAt). Resuming after a wrong answer includes each question's guide.
|
|
1027
1029
|
- Errors: build_reward_not_scheduled when the rule has no questions for today; build_reward_daily_claims_reached when the viewer already earned today’s cap. attemptsRemaining is null for unlimited rules.
|
|
1028
1030
|
- For a completion rule call start when the activity begins (the moment the stage starts); the challenge's age is what the claim is measured against. In preview mode start also works for the owner (a stateless simulation).
|
|
1029
|
-
-
|
|
1031
|
+
- For completionProof: classic-tower-v1, start also returns completion { profile, token, maxFrames, completed, failed }. A new start resets only the simulated climb to its canonical spawn; it cannot reset daily or lifetime rewards. Record inputs from the first physics frame. The completion token is bound to the viewer, challenge, rule and published release.
|
|
1032
|
+
- await Twinkle.rewards.progress({ challengeId, completionToken, frames }) | scopes: rewards:claim
|
|
1033
|
+
- Returns: { mode: "live" | "preview", completion: { profile: "classic-tower-v1", token, maxFrames, completed, failed } }
|
|
1034
|
+
- Verify a bounded batch of inputs for an approved server-simulated climb.
|
|
1035
|
+
- Only for completionProof: classic-tower-v1. Send 1 to 600 chronological physics frames, each [dt, moveX, moveY, cameraForwardX, cameraForwardZ, jumpPressed, jumpHeld, speedMultiplier]. dt is in seconds, at most 0.05; movement axes are -1 through 1; the camera values are the horizontal components before normalization; jump flags are 0 or 1; speedMultiplier is an existing Classic Tower trail speed (1, 1.1, 1.2, 1.3, 1.35 or 1.4). Geometry and player state are owned by the registered server simulation.
|
|
1036
|
+
- Send occasional batches with at most one request in flight. Keep the previous token and the exact batch until a response confirms it; an identical retry is safe. Use the returned token for the next batch. Simulation time cannot outrun wall time. A completed token is evidence of a legal simulated run, not proof that a human played or that inputs were not automated.
|
|
1037
|
+
- On respawn or a return from another world, begin a fresh run at the canonical spawn via start. Preserve other worlds and gameplay. Do not submit positions, scores, secret keys, or a client completion flag. Preview tokens can never be redeemed in the published app.
|
|
1038
|
+
- await Twinkle.rewards.claim({ challengeId, answers?: [number], completionToken?: string }) | scopes: rewards:claim
|
|
1030
1039
|
- Returns: { awarded: false, attempts, attemptsRemaining, questions: [{ prompt, hint?, guide? }] } | { awarded: true, duplicate, receipt: { ruleId, xp, coins, attempt, firstTry }, questions: [{ prompt, hint?, guide? }], balances: { xp, coins } }
|
|
1031
1040
|
- Twinkle verifies every answer, approval, current published artifact and budget before atomically recording XP and Coins. The receipt’s xp/coins are what was actually paid: the full amounts on a first try, the retry share after a wrong answer (attempt > 1). Retry the same challengeId after a lost response; a confirmed claim returns its original receipt without another award. Never update balance UI optimistically. Under retry.paidAttempts a correct answer past that attempt returns awarded: true with a zero receipt: solved, not paid.
|
|
1032
1041
|
- Every claim response, wrong or right, returns the questions with their guides unlocked: show the teaching content right after the first answer. Answer keys are never returned.
|
|
1033
1042
|
- A wrong answer within two seconds of the previous one is refused with build_reward_throttled (HTTP 429) and does not count; wait for the person to try again rather than retry-looping.
|
|
1034
1043
|
- Completion rules take no answers: claim({ challengeId }) when the activity is finished. build_reward_too_fast (HTTP 409) means fewer than minSeconds passed since start; show nothing and let play continue. In preview mode the receipt carries preview: true and nothing is paid.
|
|
1044
|
+
- A completionProof rule also requires the signed completionToken from a successful rewards.progress response. The server simulates the registered game physics and must reach the goal. A timer, forged position, client win flag, altered inventory or token from another viewer, challenge or release cannot authorize payment. maxLifetimeClaims is enforced from receipts in the same award transaction. build_reward_lifetime_claims_reached means all rewards for this rule have been collected; do not retry it.
|
|
1035
1045
|
- await Twinkle.rewards.getLeaderboard({ metric?: "xp" | "coins", period?: "day" | "week" | "all", limit? }) | scopes: rewards:claim
|
|
1036
1046
|
- Returns: { mode: "live", metric, period, limit, dayKey, from, available: { xp, coins }, entries: [{ rank, userId, username, profilePicUrl, xp, coins, claims, lastAt }], me: { rank, xp, coins, claims } | null } | { mode: "preview", metric, period, available, entries: [], me: null, message }
|
|
1037
1047
|
- 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.
|
package/sdk/LUMINE_ADMIN.md
CHANGED
|
@@ -2995,6 +2995,33 @@ Mikey"** section carrying only
|
|
|
2995
2995
|
the deltas and anomalies worth his time, next to the escalation list. Never
|
|
2996
2996
|
dump raw sections at him.
|
|
2997
2997
|
|
|
2998
|
+
### Jev shadow pilot (standing duty, every full daily review; added 2026-09-19)
|
|
2999
|
+
|
|
3000
|
+
Read `data.jevPilot` from `lumine admin brief --json` and carry it into
|
|
3001
|
+
the full report for Mikey. The active `daily-run report --json` also includes
|
|
3002
|
+
`data.report.brief.jevPilot`. This duty does not authorize a separate full run.
|
|
3003
|
+
If the deployed API lacks the field, say the telemetry is not deployed; do not
|
|
3004
|
+
treat a missing section as zero traffic or a healthy pilot.
|
|
3005
|
+
|
|
3006
|
+
State the configuration and operating status even when off/blocked/awaiting
|
|
3007
|
+
samples. Headline the named last completed UTC day, compare with the trailing
|
|
3008
|
+
seven completed days, and keep the in-progress day separate. Include paired
|
|
3009
|
+
decision counts, disagreements (especially Jev react / baseline respond),
|
|
3010
|
+
p50/p95 latency for each model, provider errors/timeouts, pending observations,
|
|
3011
|
+
known incremental cost, unknown-cost requests, ledger gaps and cap status.
|
|
3012
|
+
The pilot's known recorded spend is already in application AI costs: never add
|
|
3013
|
+
it again. Shadow mode changes no user-visible decisions and has not established
|
|
3014
|
+
savings. Agreement is not accuracy; confidence is not a measured success rate.
|
|
3015
|
+
|
|
3016
|
+
Privately inspect the bounded `reviewCandidates` when needed, name what was
|
|
3017
|
+
actually reviewed, and account for edited comments. Ordinary model disagreements
|
|
3018
|
+
are evaluation findings; outages, stuck telemetry or missing ledger entries are
|
|
3019
|
+
operational findings. Report a recommendation to continue, adjust or stop, without
|
|
3020
|
+
automatically enabling traffic, raising caps or promoting Jev to serving. Data
|
|
3021
|
+
handling for under-18 users and TypeSafe account access must be resolved before
|
|
3022
|
+
real conversations are sent. See `twinkle-api/JEV_PILOT.md` for configuration,
|
|
3023
|
+
the synthetic evaluation step and release checks.
|
|
3024
|
+
|
|
2998
3025
|
### Application AI calendar-month cost (standing duty, every full daily review)
|
|
2999
3026
|
|
|
3000
3027
|
Run `lumine admin ai-costs monthly --json` during every full daily management
|