@stage5/lumine 0.2.40 → 0.2.41
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 +66 -13
- package/lib/admin-news.js +236 -0
- package/lib/admin-workflows.js +419 -0
- package/lib/admin.js +495 -44
- package/lib/agent/mcp-server.js +138 -0
- package/lib/agent/providers/claude-code.js +214 -0
- package/lib/agent/providers/codex.js +522 -0
- package/lib/agent/providers/environment.js +40 -0
- package/lib/agent/providers/index.js +38 -0
- package/lib/agent/tool-session.js +301 -0
- package/lib/agent/trace.js +138 -0
- package/lib/agent.js +453 -0
- package/lib/api.js +81 -1
- package/lib/build-review.js +493 -0
- package/lib/commands.js +80 -9
- package/lib/constants.js +2 -0
- package/package.json +1 -1
- package/sdk/BUILD_SDK_INDEX.md +24 -3
- package/sdk/LUMINE_ADMIN.md +95 -20
package/sdk/BUILD_SDK_INDEX.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Build SDK Index
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
4
|
-
Updated: 2026-08-
|
|
5
|
-
Generated: 2026-08-
|
|
3
|
+
Version: 1.33.0
|
|
4
|
+
Updated: 2026-08-15
|
|
5
|
+
Generated: 2026-08-15T03:00:24.685Z
|
|
6
6
|
|
|
7
7
|
## Notes
|
|
8
8
|
- This SDK is injected into Build iframes via the Build preview/runtime.
|
|
@@ -76,6 +76,27 @@ files:read, user:read, users:read, dailyReflections:read, content:read, content:
|
|
|
76
76
|
- Returns: Canonical shareable deep-link URL string, or null when app info is unavailable
|
|
77
77
|
- Builds a canonical shareable deep link into this app, e.g. https://www.twin-kle.com/app/884/432-the-great-gatsby.
|
|
78
78
|
- Example: await Twinkle.app.getShareUrl('432-the-great-gatsby');
|
|
79
|
+
- history.getState() | scopes: none
|
|
80
|
+
- Returns: The current app-owned history state object, or null
|
|
81
|
+
- Read the current Build app view state stored through Twinkle.app.history.
|
|
82
|
+
- History state is local to this iframe session and never changes the parent Twinkle URL.
|
|
83
|
+
- Use this for archive/detail/page state inside one Build document; use navigate() to load another project file.
|
|
84
|
+
- history.push(state) | scopes: none
|
|
85
|
+
- Returns: A JSON-cloned copy of the stored state
|
|
86
|
+
- Add a confirmed in-app view transition to browser history so Back stays inside the Build app.
|
|
87
|
+
- State must be a JSON-serializable object no larger than 16 KB.
|
|
88
|
+
- Push only after the requested view has loaded successfully; do not synthesize server-owned state.
|
|
89
|
+
- Example: Twinkle.app.history.push({ view: 'edition', dayIndex: 2080, page: 'scores' });
|
|
90
|
+
- history.replace(state) | scopes: none
|
|
91
|
+
- Returns: A JSON-cloned copy of the stored state
|
|
92
|
+
- Replace the current in-app history entry without adding a Back step.
|
|
93
|
+
- Use this to establish the initial confirmed view or reconcile a loading-only change.
|
|
94
|
+
- history.subscribe(listener, { immediate } = {}) | scopes: none
|
|
95
|
+
- Returns: unsubscribe function
|
|
96
|
+
- Restore app views when the viewer moves through browser Back or Forward history.
|
|
97
|
+
- The listener receives a cloned app state object, or null for an entry not owned by this app.
|
|
98
|
+
- The listener is called immediately by default; pass { immediate: false } to wait for Back or Forward.
|
|
99
|
+
- Example: const off = Twinkle.app.history.subscribe((state) => restoreView(state), { immediate: false });
|
|
79
100
|
- async navigate(target) | scopes: none
|
|
80
101
|
- Returns: { success, src }
|
|
81
102
|
- Navigate to another Build preview route through the parent bridge without dropping Twinkle SDK access.
|
package/sdk/LUMINE_ADMIN.md
CHANGED
|
@@ -95,6 +95,12 @@ The CLI enforces none of this — it is the standing instruction for the operato
|
|
|
95
95
|
or agent making the judgments, and it applies to every verb below: recommends,
|
|
96
96
|
rewards, effort levels, Featured, skips, comments, and replies.
|
|
97
97
|
|
|
98
|
+
Public text authored as Ciel must be English. This is an operator and generation
|
|
99
|
+
instruction, not a script or keyword test: writing systems do not identify a
|
|
100
|
+
language reliably, and the API must not pretend otherwise. This is a
|
|
101
|
+
presentation rule, not an invitation to correct or lecture a member who writes
|
|
102
|
+
in another language; reply naturally in concise English.
|
|
103
|
+
|
|
98
104
|
**Twinkle is not Reddit.** Do not rank a run's attention by popularity,
|
|
99
105
|
recommendation count, or polish. Most users here are young children, and the
|
|
100
106
|
posts that most need Zero or Ciel are the ones nobody else answered.
|
|
@@ -168,6 +174,13 @@ a human owner can decide, and a finding nobody reports is a finding that did not
|
|
|
168
174
|
happen. **Every run ends with an escalation list**, and it belongs in the run's
|
|
169
175
|
final report whether or not anyone asks for it.
|
|
170
176
|
|
|
177
|
+
Keep that list narrow enough to be useful. Escalate concrete child-safety,
|
|
178
|
+
exploitation, privacy, targeted harassment, or platform/system-abuse risk — not
|
|
179
|
+
ordinary children experimenting, arguing, making rumors, proposing informal
|
|
180
|
+
in-site loans or contests, asking where media can be found, or making an
|
|
181
|
+
unverified ownership claim. Those may merit a normal age-appropriate response,
|
|
182
|
+
but they are not escalations without credible harmful conduct or a real victim.
|
|
183
|
+
|
|
171
184
|
Escalate, with the canonical `https://www.twin-kle.com/subjects/<id>` or
|
|
172
185
|
`/comments/<id>` URL, a one-line summary, and why it needs him:
|
|
173
186
|
|
|
@@ -178,11 +191,10 @@ Escalate, with the canonical `https://www.twin-kle.com/subjects/<id>` or
|
|
|
178
191
|
happened. These outrank every other category.
|
|
179
192
|
- **Account integrity** — someone posting from another person's account,
|
|
180
193
|
impersonation, shared logins, or a user operating a set of alternate accounts.
|
|
181
|
-
- **Economy
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
kids are recommending is spreading, and that is the urgent part.
|
|
194
|
+
- **Economy exploitation** — coordinated coin or XP farming across alternate
|
|
195
|
+
accounts, coercive or deceptive arrangements, or a repeatable abuse of the
|
|
196
|
+
platform economy with concrete evidence. A child offering a voluntary loan,
|
|
197
|
+
repayment, prize, or contest is not enough by itself.
|
|
186
198
|
- **AI-cost exploits** — patterns that convert free AI allowances into farmable
|
|
187
199
|
value: clusters of young accounts with heavy AI/battery usage, one person
|
|
188
200
|
operating many accounts that feed a single build through team branches,
|
|
@@ -446,6 +458,11 @@ lumine admin daily-run start --identity auto --comment-mode off --json
|
|
|
446
458
|
lumine admin daily-run start --identity ciel --comment-mode draft \
|
|
447
459
|
--run-key daily:2026-08-06:review --json
|
|
448
460
|
lumine admin daily-run status --json
|
|
461
|
+
lumine admin daily-run escalation add --target subject:123 \
|
|
462
|
+
--note "Public contact details need owner review" --severity urgent --json
|
|
463
|
+
lumine admin daily-run escalation add --target chatMessage:3768159 \
|
|
464
|
+
--note "Concrete safety issue in a bot-authored chat message" --json
|
|
465
|
+
lumine admin daily-run report --json
|
|
449
466
|
lumine admin daily-run complete --json
|
|
450
467
|
lumine admin daily-run fail --reason "operator stopped" --json
|
|
451
468
|
```
|
|
@@ -465,6 +482,14 @@ type DailyRunComplete = Success<{
|
|
|
465
482
|
type DailyRunFail = DailyRunComplete;
|
|
466
483
|
```
|
|
467
484
|
|
|
485
|
+
Record only qualifying escalations as they are confirmed. `daily-run report`
|
|
486
|
+
then composes the active run's canonical audit events, successful mutations,
|
|
487
|
+
completed queue scans, recorded escalations, and the most useful brief deltas
|
|
488
|
+
into one result. Generate it before `complete`, because run-scoped reads require
|
|
489
|
+
the current active run. Queue coverage is written automatically only after an
|
|
490
|
+
`--all` traversal reaches canonical exhaustion; an interrupted scan remains in
|
|
491
|
+
its local checkpoint and cannot be misreported as complete.
|
|
492
|
+
|
|
468
493
|
`lastRun` makes a lost-response retry of `complete` or `fail` possible after
|
|
469
494
|
the active pointer has been cleared. Other run-scoped commands accept only the
|
|
470
495
|
current unexpired `active` run. Completion first finalizes any mutation whose
|
|
@@ -498,13 +523,17 @@ JSON error includes `details.retryIdempotencyKey` for a safe exact retry.
|
|
|
498
523
|
|
|
499
524
|
```bash
|
|
500
525
|
lumine admin recommendations list --kind recommend \
|
|
501
|
-
--content-types comment,dailyReflection --
|
|
526
|
+
--content-types comment,dailyReflection --all --json
|
|
527
|
+
lumine admin recommendations list --after 2026-08-14T00:00:00Z \
|
|
528
|
+
--all --checkpoint recommendations.json --json
|
|
529
|
+
lumine admin recommendations list --include-legacy --all --json
|
|
502
530
|
lumine admin recommendations list --unviewed --json
|
|
503
531
|
lumine admin subjects candidates --after 2026-08-01T00:00:00Z \
|
|
504
|
-
--
|
|
532
|
+
--all --checkpoint subjects.json --json
|
|
505
533
|
lumine admin subjects candidates --effort unassigned --json
|
|
506
534
|
lumine admin subjects candidates --unviewed --json
|
|
507
|
-
lumine admin builds candidates --
|
|
535
|
+
lumine admin builds candidates --all --limit 50 --json
|
|
536
|
+
lumine admin builds review build:884 --output-dir ./build-review --json
|
|
508
537
|
```
|
|
509
538
|
|
|
510
539
|
Schemas:
|
|
@@ -575,12 +604,28 @@ type BuildCandidates = Success<{
|
|
|
575
604
|
}>;
|
|
576
605
|
```
|
|
577
606
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
607
|
+
Subject cursors freeze a primary-key high-water mark and traverse descending
|
|
608
|
+
IDs. Bounded recommendation cursors freeze both the feed-ID high-water mark and
|
|
609
|
+
the server timestamp, then traverse the indexed `(timeStamp, id)` order; this
|
|
610
|
+
also catches a Daily Reflection whose old feed row moved forward when it was
|
|
611
|
+
reshared. Explicit legacy scans retain the descending primary-key walk. A page
|
|
612
|
+
can be empty while `hasMore` remains true; continue until `exhausted`. `--all`
|
|
613
|
+
does that automatically and writes a private checkpoint after every
|
|
614
|
+
server-confirmed page; `--resume` continues only when the checkpoint belongs to
|
|
615
|
+
the same API, run, and exact request. The final result can be copied to
|
|
616
|
+
`--output`, while `--checkpoint` is resumable operational state. Subject
|
|
617
|
+
`--after` is inclusive, and every opaque cursor is bound to its original
|
|
618
|
+
filters.
|
|
619
|
+
|
|
620
|
+
Recommendations default to `--since-run`: the server uses the previous
|
|
621
|
+
completed run's start time (or the same bounded seven-day fallback used by the
|
|
622
|
+
brief on a first run). That deliberate start-to-start overlap gives the queue
|
|
623
|
+
at-least-once coverage when content arrives after the prior snapshot but before
|
|
624
|
+
that run completes. `--after` supplies an explicit inclusive timestamp.
|
|
625
|
+
All-history traversal is deliberately available only through
|
|
626
|
+
`--include-legacy`. The CLI requires the API to echo the canonical `after`
|
|
627
|
+
boundary for bounded modes, so deploying a new CLI against an older API cannot
|
|
628
|
+
silently fall back to a million-row historical scan.
|
|
584
629
|
|
|
585
630
|
`builds candidates` is a management-agent discovery view over the canonical
|
|
586
631
|
public Build browser, ordered by the current published release. It is
|
|
@@ -592,6 +637,15 @@ genuinely try the published runtime, or pull and read an open-source project,
|
|
|
592
637
|
before making that judgment. Direct API/persona automation is never a review
|
|
593
638
|
substitute.
|
|
594
639
|
|
|
640
|
+
`builds review` is the managed runtime path: it fetches the current published
|
|
641
|
+
artifact identity, launches the app in an isolated temporary Chromium profile,
|
|
642
|
+
captures a screenshot and bounded console evidence, then fetches the identity
|
|
643
|
+
again. It writes `review.json` in a unique per-review subdirectory only when
|
|
644
|
+
the browser completed, the screenshot exists, and the artifact did not change
|
|
645
|
+
mid-review. Attach the returned `receiptPath` with
|
|
646
|
+
`comment draft ... --review-receipt review.json`; this binds the draft to the
|
|
647
|
+
exact reviewed artifact without copying a version number by hand.
|
|
648
|
+
|
|
595
649
|
During every management run, scan recent Build candidates back through the
|
|
596
650
|
run's review window alongside Subjects and the recommendation queue. An app
|
|
597
651
|
that is thin, broken, private, unchanged since a prior substantive bot
|
|
@@ -919,6 +973,10 @@ If recommendation succeeds but reward fails, the command exits nonzero with
|
|
|
919
973
|
```bash
|
|
920
974
|
lumine admin post skip dailyReflection:99 --json
|
|
921
975
|
lumine admin post skip comment:456 --reason "one-line answer, nothing to add" --json
|
|
976
|
+
lumine admin post skip-batch --target-file skip-targets.json \
|
|
977
|
+
--checkpoint skip-progress.json --json
|
|
978
|
+
lumine admin post skip-batch --target-file skip-targets.json \
|
|
979
|
+
--checkpoint skip-progress.json --resume --json
|
|
922
980
|
```
|
|
923
981
|
|
|
924
982
|
A skip records that the management rotation has judged a recommend-queue item
|
|
@@ -937,6 +995,13 @@ metadata — it is the agent's memory of the judgment, not public content.
|
|
|
937
995
|
The skip requires the `recommendation:write` scope and is audited like every
|
|
938
996
|
other mutation.
|
|
939
997
|
|
|
998
|
+
`skip-batch` accepts either a JSON array (strings or `{ "target", "reason" }`
|
|
999
|
+
objects), `{ "targets": [...] }`, or one target per text line. It deduplicates
|
|
1000
|
+
targets, submits them sequentially through the same canonical audited endpoint,
|
|
1001
|
+
and checkpoints only after each response is confirmed. `--resume` verifies the
|
|
1002
|
+
exact target-set fingerprint and run ID before continuing; it never guesses
|
|
1003
|
+
which writes succeeded.
|
|
1004
|
+
|
|
940
1005
|
```ts
|
|
941
1006
|
type PostSkip = Success<{
|
|
942
1007
|
skip: {
|
|
@@ -953,9 +1018,10 @@ type PostSkip = Success<{
|
|
|
953
1018
|
|
|
954
1019
|
```bash
|
|
955
1020
|
lumine admin news --json
|
|
956
|
-
lumine admin news claim --json
|
|
957
|
-
lumine admin news
|
|
958
|
-
|
|
1021
|
+
lumine admin news claim --output claim.json --scaffold editorial.json --json
|
|
1022
|
+
lumine admin news validate --claim claim.json --file editorial.json --json
|
|
1023
|
+
lumine admin news submit --claim claim.json --file editorial.json \
|
|
1024
|
+
--model "Ciel" --json
|
|
959
1025
|
lumine admin news print --json
|
|
960
1026
|
```
|
|
961
1027
|
|
|
@@ -968,9 +1034,18 @@ the run, and if `printedToday` is false with no edition `pending` or
|
|
|
968
1034
|
**Preferred: write the editorial yourself.** `news claim` reserves today's
|
|
969
1035
|
edition under the server's generation lease and returns the exact canonical
|
|
970
1036
|
event digest the server would otherwise send to its own model, so no provider
|
|
971
|
-
API credits are spent.
|
|
972
|
-
|
|
973
|
-
|
|
1037
|
+
API credits are spent. With `--output` and `--scaffold`, the CLI writes that
|
|
1038
|
+
lease/digest to a private claim file and creates an editable editorial shell.
|
|
1039
|
+
`news validate` runs locally, before authentication or a network request, and
|
|
1040
|
+
checks the complete citation graph plus byte-exact quote boundaries. Submit the
|
|
1041
|
+
validated pair with `news submit --claim`; the CLI reads the edition and lease
|
|
1042
|
+
from the claim file and validates again immediately before the request. The
|
|
1043
|
+
explicit `--edition-id` / `--lease-token` form remains available for backwards
|
|
1044
|
+
compatibility.
|
|
1045
|
+
|
|
1046
|
+
Write a `GeneratedEditorial` JSON and send it back within the ten-minute lease.
|
|
1047
|
+
The server still treats the editorial as untrusted regardless of author: every
|
|
1048
|
+
story must cite an exact `eventKey`
|
|
974
1049
|
from the digest, front-page `sourceQuote`s must be verbatim contiguous
|
|
975
1050
|
passages of the cited event's summary (invalid quotes are replaced with
|
|
976
1051
|
canonical text), section and page layout are server-enforced, announcements
|