@stage5/lumine 0.2.17 → 0.2.19
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/README.md +78 -0
- package/bin/lumine.js +6 -1
- package/lib/admin.js +770 -0
- package/lib/api.js +68 -0
- package/lib/commands.js +491 -21
- package/lib/constants.js +14 -0
- package/lib/http.js +4 -1
- package/package.json +1 -1
- package/sdk/BUILD_SDK_INDEX.md +36 -20
- package/sdk/LUMINE_ADMIN.md +715 -0
package/lib/constants.js
CHANGED
|
@@ -170,6 +170,16 @@ lumine save --summary "Describe the change"
|
|
|
170
170
|
need --allow-write and mutate real app data.
|
|
171
171
|
- Owned canonical builds may be published only when the user explicitly asks.
|
|
172
172
|
|
|
173
|
+
## Team Suggestions
|
|
174
|
+
|
|
175
|
+
- After saving contribution-branch work, use \`lumine suggest branch "Ready for review"\`
|
|
176
|
+
when the user wants to notify the project owner. Use \`lumine suggest thumbnail\`
|
|
177
|
+
when the branch's current thumbnail should be offered to the owner.
|
|
178
|
+
- On an owned canonical team project, \`lumine suggestions\` lists the owner's
|
|
179
|
+
currently open branch and thumbnail suggestions. Act on the exact suggestion
|
|
180
|
+
id it prints with \`lumine suggestions merge\`, \`replace-main\`, or
|
|
181
|
+
\`adopt-thumbnail\`; do not infer an action from stale local branch state.
|
|
182
|
+
|
|
173
183
|
## Assets (Runtime Media)
|
|
174
184
|
|
|
175
185
|
- Binary files are NOT project files. Never place bundled media in this
|
|
@@ -320,14 +330,18 @@ export const MAIN_CHECKOUT_READONLY_COMMANDS = new Set([
|
|
|
320
330
|
"versions",
|
|
321
331
|
]);
|
|
322
332
|
export const COMMANDS = new Set([
|
|
333
|
+
"admin",
|
|
323
334
|
"workspace",
|
|
324
335
|
"login",
|
|
325
336
|
"logout",
|
|
326
337
|
"whoami",
|
|
327
338
|
"new",
|
|
328
339
|
"rename",
|
|
340
|
+
"describe",
|
|
329
341
|
"projects",
|
|
330
342
|
"branches",
|
|
343
|
+
"suggest",
|
|
344
|
+
"suggestions",
|
|
331
345
|
"explore",
|
|
332
346
|
"select",
|
|
333
347
|
"pull",
|
package/lib/http.js
CHANGED
|
@@ -20,7 +20,10 @@ export async function requestJson({
|
|
|
20
20
|
const data = parseJson(text);
|
|
21
21
|
if (!response.ok) {
|
|
22
22
|
const error = new Error(
|
|
23
|
-
data?.error
|
|
23
|
+
data?.error?.message ||
|
|
24
|
+
(typeof data?.error === "string" ? data.error : "") ||
|
|
25
|
+
data?.message ||
|
|
26
|
+
`${method} ${url} failed`,
|
|
24
27
|
);
|
|
25
28
|
error.status = response.status;
|
|
26
29
|
error.data = data;
|
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.
|
|
4
|
-
Updated: 2026-
|
|
5
|
-
Generated: 2026-
|
|
3
|
+
Version: 1.32.0
|
|
4
|
+
Updated: 2026-08-02
|
|
5
|
+
Generated: 2026-08-02T03:03:30.002Z
|
|
6
6
|
|
|
7
7
|
## Notes
|
|
8
8
|
- This SDK is injected into Build iframes via the Build preview/runtime.
|
|
@@ -12,7 +12,7 @@ Generated: 2026-07-31T05:39:44.540Z
|
|
|
12
12
|
- Match storage to update frequency: privateDb and sharedDb are for LOW-frequency durable state that changes on a user action. NEVER write per-frame/per-tick state to them (camera or cursor position, animation, live movement, presence, autosave every frame/tick). Keep live state in client memory, broadcast realtime/presence via Twinkle.world, and flush only occasional durable snapshots (on an interval or on exit, never per frame). The server enforces per-key write rate limits and returns 429 on excess; never retry-loop a 429.
|
|
13
13
|
- Use Twinkle.userDb only for advanced private SQLite needs such as tables, indexes, many rows, filtered queries, or aggregates.
|
|
14
14
|
- Use Twinkle.leaderboards for public Build scoreboards. Signed-in viewers are ranked by Twinkle username; guests can submit with a display name.
|
|
15
|
-
- Use Twinkle.news to read the globally shared Twinkle Daily edition or let a signed-in viewer queue today's edition. The server permits only one
|
|
15
|
+
- Use Twinkle.news to read the globally shared Twinkle Daily edition, browse canonical daily archives and preserved successful press runs, or let a signed-in viewer queue today's edition. The server permits only one canonical edition per Twinkle day for ordinary viewers. In the canonical Twinkle Newspaper app, its current owner may explicitly refresh today's ready edition, appending a revision while keeping the newest successful press run canonical. A model-backed edition consumes AI Energy from the signed-in viewer whose request creates, retries, or refreshes that job; deduplicated observers and quiet editions with no editorial model call do not consume Energy.
|
|
16
16
|
- Use Twinkle.sharedDb for LOW-frequency durable shared multi-user state such as guestbooks, votes, room settings, submitted records, and append-only run history. It is NOT for high-frequency or per-frame/per-tick writes; keep live/realtime state in Twinkle.world or client memory. The server rate-limits writes and returns 429.
|
|
17
17
|
- Use Twinkle.subjects.search for in-app subject pickers. Twinkle.mount remains an optional host-provided preselection/context shortcut, not a data API.
|
|
18
18
|
- Use Twinkle.aiCards for read-only existing public AI Card words and example texts, including word levels for typing games.
|
|
@@ -306,11 +306,11 @@ const result = await Twinkle.ai.chat({ message, history: chatHistory, systemProm
|
|
|
306
306
|
- Use this instead of asking Twinkle.ai.chat to return JSON.
|
|
307
307
|
- expectedStructure must be a JSON object that describes the exact returned object shape.
|
|
308
308
|
- mode is accepted as an alias for thinkingMode, and mid is accepted as an alias for medium.
|
|
309
|
-
- thinkingMode low uses GPT-5.6 Luna and
|
|
310
|
-
- thinkingMode medium uses Grok 4.5 with medium reasoning and normal AI Energy
|
|
311
|
-
- thinkingMode high uses GPT-5.6 Sol with high reasoning and high AI Energy
|
|
312
|
-
-
|
|
313
|
-
- Live web search is enabled by default in Medium and High modes. Pass webSearch: false to disable it for the app.
|
|
309
|
+
- thinkingMode low uses GPT-5.6 Luna and consumes the viewer's AI Energy from confirmed provider usage; its smaller model is usually cheaper than Medium or High.
|
|
310
|
+
- thinkingMode medium uses Grok 4.5 with medium reasoning and consumes normal AI Energy.
|
|
311
|
+
- thinkingMode high uses GPT-5.6 Sol with high reasoning and consumes high AI Energy.
|
|
312
|
+
- When AI Energy is empty, Low, Medium, and High all reject before new provider work; there is no free fallback mode.
|
|
313
|
+
- Live web search is enabled by default in Medium and High modes. Pass webSearch: false to disable it for the app. Low/Lite Mode remains tool-free; explicitly forcing webSearch: true in Low Mode returns an error.
|
|
314
314
|
- The SDK validates shape and retries malformed JSON, but app code should still validate business-specific enum values.
|
|
315
315
|
- Example: const { object } = await Twinkle.ai.generateObject({ thinkingMode: 'medium', prompt: 'Classify the player intent from: ' + playerText, expectedStructure: { action: 'string', targetCharacter: 'string', confidence: 0, shouldAskFollowUp: false } });
|
|
316
316
|
- onChatStatus(listener) | scopes: none
|
|
@@ -351,13 +351,13 @@ const result = await Twinkle.ai.chat({ message, history: chatHistory, systemProm
|
|
|
351
351
|
- The character route also accepts text or message fields for compatibility, but generated apps should use content.
|
|
352
352
|
- The server keeps the latest 16 valid character history entries.
|
|
353
353
|
- Pass onText/onStatus for streaming dialogue. Omit callbacks for non-streaming dialogue where the promise resolves with the final response.
|
|
354
|
-
- thinkingMode low uses Lite Mode: Zero uses Grok 4.5 with low reasoning and Ciel uses Claude Haiku 4.5; usage is
|
|
355
|
-
- thinkingMode medium
|
|
356
|
-
- thinkingMode high
|
|
357
|
-
-
|
|
354
|
+
- thinkingMode low uses Lite Mode: Zero uses Grok 4.5 with low reasoning and Ciel uses Claude Haiku 4.5; confirmed provider usage consumes the viewer's AI Energy and is usually cheaper than Medium or High.
|
|
355
|
+
- thinkingMode medium consumes normal AI Energy: Zero uses Grok 4.5 with medium reasoning and Ciel uses Claude Sonnet 5.
|
|
356
|
+
- thinkingMode high consumes high AI Energy: Zero uses Grok 4.5 with high reasoning and Ciel uses Claude Opus 5 with extended thinking.
|
|
357
|
+
- When AI Energy is empty, Low, Medium, and High all reject before new provider work; there is no free fallback mode.
|
|
358
358
|
- Pass roomContext as a short shared scene transcript so Zero and Ciel can know what happened in the same room.
|
|
359
359
|
- includeWebsiteContext defaults to true. Set includeWebsiteContext: false for in-world NPC dialogue that should only use Zero/Ciel's basic character identity plus your scene/instructions.
|
|
360
|
-
- Live web search is enabled by default in Medium and High modes. Pass webSearch: false to disable it for the app.
|
|
360
|
+
- Live web search is enabled by default in Medium and High modes. Pass webSearch: false to disable it for the app. Low/Lite Mode remains tool-free; explicitly forcing webSearch: true in Low Mode returns an error.
|
|
361
361
|
- includeWebsiteContext controls Twinkle persona context and is unrelated to webSearch.
|
|
362
362
|
- When streaming, onStatus may receive searching_web while the provider is searching.
|
|
363
363
|
- Use this for real Zero/Ciel NPCs instead of pretending with Twinkle.ai.chat systemPrompt.
|
|
@@ -529,19 +529,35 @@ const result = await Twinkle.characters.chat({ character: 'zero', thinkingMode:
|
|
|
529
529
|
|
|
530
530
|
### Twinkle.news
|
|
531
531
|
- async getCurrentEdition() | scopes: none
|
|
532
|
-
- Returns: { dayIndex, nextEditionAt, generationStatus, edition: { id, dayIndex, status, coverageStartedAt, coverageEndedAt, sourceEventCount, edition, model, provider, generatedAt } | null, pendingEdition }
|
|
532
|
+
- Returns: { dayIndex, nextEditionAt, generationStatus, edition: { id, dayIndex, status, coverageStartedAt, coverageEndedAt, sourceEventCount, edition, model, provider, generatedAt, revisionNumber, revisionCount } | null, pendingEdition }
|
|
533
533
|
- Read today's shared Twinkle newspaper, or the latest ready edition while today's is being generated.
|
|
534
534
|
- Works for signed-in viewers and public-build guests.
|
|
535
535
|
- generationStatus is available, pending, generating, ready, or failed.
|
|
536
|
-
- While today's edition is pending, edition remains the latest ready shared edition
|
|
536
|
+
- While today's first edition is pending, edition remains the latest ready shared edition. During an owner refresh, edition remains the earlier same-day edition. pendingEdition describes the canonical queued work in both cases.
|
|
537
537
|
- Poll gently while generation is pending; once every 5-10 seconds is sufficient.
|
|
538
|
-
- async
|
|
538
|
+
- async listEditions({ limit = 12, cursor } = {}) | scopes: none
|
|
539
|
+
- Returns: { editions: [{ id, dayIndex, dateKey, headline, deck, coverageStartedAt, coverageEndedAt, sourceEventCount, generatedAt, revisionNumber, revisionCount }], cursor, hasMore }
|
|
540
|
+
- List the canonical daily newspaper archive newest-first.
|
|
541
|
+
- Works for signed-in viewers and public-build guests.
|
|
542
|
+
- Returns compact publication summaries rather than full newspaper JSON.
|
|
543
|
+
- limit defaults to 12 and is capped at 30. Pass cursor from the previous response to load older editions.
|
|
544
|
+
- Each item describes the latest canonical revision for that Twinkle day.
|
|
545
|
+
- async getEdition({ dayIndex, revisionNumber } = {}) | scopes: none
|
|
546
|
+
- Returns: { edition: { id, revisionId?, dayIndex, status, coverageStartedAt, coverageEndedAt, sourceEventCount, edition, model, provider, generatedAt, revisionNumber, revisionCount }, revisions: [{ revisionId, revisionNumber, coverageStartedAt, coverageEndedAt, sourceEventCount, model, provider, generatedAt, createdAt }], selectedRevisionNumber, canonicalRevisionNumber }
|
|
547
|
+
- Read one canonical daily edition or an exact preserved successful press run.
|
|
548
|
+
- Works for signed-in viewers and public-build guests.
|
|
549
|
+
- dayIndex is required. Omit revisionNumber to read that day's latest canonical edition.
|
|
550
|
+
- Pass a revisionNumber returned in revisions to read that exact successful press run.
|
|
551
|
+
- Historical revisions remain subject to canonical privacy and deletion redactions.
|
|
552
|
+
- async generateCurrentEdition({ refresh = false } = {}) | scopes: none
|
|
539
553
|
- Returns: { dayIndex, nextEditionAt, generationStatus, edition, pendingEdition }
|
|
540
554
|
- Atomically queue the current Twinkle day's globally shared edition.
|
|
541
555
|
- Requires a signed-in viewer.
|
|
542
|
-
- The first request for a Twinkle day creates the canonical pending edition; concurrent and later requests return that same server state.
|
|
543
|
-
-
|
|
544
|
-
-
|
|
556
|
+
- The first request for a Twinkle day creates the canonical pending edition; concurrent and later ordinary requests return that same server state.
|
|
557
|
+
- In the canonical Twinkle Newspaper app, its current owner may pass { refresh: true } to revise an already-ready same-day edition using the latest canonical events. Every successful refresh is appended as a preserved press run and becomes that day's canonical revision. Ownership is checked by the server at request time and therefore follows an app transfer.
|
|
558
|
+
- When this request creates, retries, or refreshes a model-backed edition, confirmed provider usage consumes AI Energy from this requesting viewer. Concurrent or later callers that deduplicate onto the same pending or ready edition are not charged.
|
|
559
|
+
- A quiet edition with no editorial events does not call an AI provider and does not consume AI Energy.
|
|
560
|
+
- A failed attempt may be queued again on the same day. A ready edition is immutable for ordinary viewers.
|
|
545
561
|
|
|
546
562
|
### Twinkle.leaderboards
|
|
547
563
|
- async get({ boardKey = 'default', limit, cursor } = {}) | scopes: none
|