@stage5/lumine 0.2.18 → 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 +58 -0
- package/bin/lumine.js +6 -1
- package/lib/admin.js +770 -0
- package/lib/commands.js +66 -2
- package/lib/constants.js +1 -0
- package/lib/http.js +4 -1
- package/package.json +1 -1
- package/sdk/LUMINE_ADMIN.md +715 -0
package/lib/commands.js
CHANGED
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
import { probeUrl, requestJson } from "./http.js";
|
|
66
66
|
import { sdkCommand } from "./sdk.js";
|
|
67
67
|
import { doctorCommand, normalizePreviewUrl } from "./doctor.js";
|
|
68
|
+
import { adminCommand } from "./admin.js";
|
|
68
69
|
import {
|
|
69
70
|
defaultMainCheckoutDir,
|
|
70
71
|
defaultReferenceDir,
|
|
@@ -108,10 +109,15 @@ export async function main() {
|
|
|
108
109
|
printHelp();
|
|
109
110
|
return;
|
|
110
111
|
}
|
|
111
|
-
if (options.updateCheck) {
|
|
112
|
+
if (options.updateCheck && !(options.command === "admin" && options.json)) {
|
|
112
113
|
await maybeCheckForLumineCliUpdate({ options });
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
if (options.command === "admin") {
|
|
117
|
+
await adminCommand(options);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
115
121
|
if (options.command === "workspace") {
|
|
116
122
|
await workspace(options);
|
|
117
123
|
return;
|
|
@@ -2088,6 +2094,8 @@ export function parseArgs(args) {
|
|
|
2088
2094
|
"json",
|
|
2089
2095
|
"keepAssets",
|
|
2090
2096
|
"noBrowser",
|
|
2097
|
+
"includeComments",
|
|
2098
|
+
"anyoneCanReward",
|
|
2091
2099
|
]);
|
|
2092
2100
|
|
|
2093
2101
|
for (let i = 0; i < rest.length; i += 1) {
|
|
@@ -2156,6 +2164,27 @@ export function parseArgs(args) {
|
|
|
2156
2164
|
: ""),
|
|
2157
2165
|
).trim() || "",
|
|
2158
2166
|
cursor: Math.max(0, Math.floor(Number(raw.cursor) || 0)),
|
|
2167
|
+
adminCursor: raw.cursor ? String(raw.cursor) : "",
|
|
2168
|
+
adminAfter: raw.after ? String(raw.after) : "",
|
|
2169
|
+
adminEffort: raw.effort ? String(raw.effort) : "",
|
|
2170
|
+
adminLevel: raw.level ? String(raw.level) : "",
|
|
2171
|
+
adminIds: raw.subjectIds
|
|
2172
|
+
? String(raw.subjectIds)
|
|
2173
|
+
: raw.ids
|
|
2174
|
+
? String(raw.ids)
|
|
2175
|
+
: "",
|
|
2176
|
+
adminType: raw.type ? String(raw.type) : "",
|
|
2177
|
+
adminKind: raw.kind ? String(raw.kind) : "",
|
|
2178
|
+
adminIdentity: raw.identity ? String(raw.identity) : "",
|
|
2179
|
+
commentMode: raw.commentMode ? String(raw.commentMode) : "",
|
|
2180
|
+
runKey: raw.runKey ? String(raw.runKey) : "",
|
|
2181
|
+
idempotencyKey: raw.idempotencyKey ? String(raw.idempotencyKey) : "",
|
|
2182
|
+
draftId: raw.draftId ? String(raw.draftId) : "",
|
|
2183
|
+
twinkles: raw.twinkles ? String(raw.twinkles) : "",
|
|
2184
|
+
adminReason: raw.reason ? String(raw.reason) : "",
|
|
2185
|
+
rewardTwinkles: raw.rewardTwinkles ? String(raw.rewardTwinkles) : "",
|
|
2186
|
+
includeComments: parseBoolean(raw.includeComments, false),
|
|
2187
|
+
anyoneCanReward: parseBoolean(raw.anyoneCanReward, false),
|
|
2159
2188
|
repeat: Math.min(Math.max(Math.floor(Number(raw.repeat) || 1), 1), 20),
|
|
2160
2189
|
allowWrite: parseBoolean(raw.allowWrite, false),
|
|
2161
2190
|
assumeYes: parseBoolean(raw.yes, false),
|
|
@@ -2468,6 +2497,21 @@ export function printHelp() {
|
|
|
2468
2497
|
lumine thumbnail capture [--out <file>]
|
|
2469
2498
|
lumine thumbnail generate ["<prompt>"] --model <gpt-image-2|nano-banana>
|
|
2470
2499
|
lumine doctor runtime-assets
|
|
2500
|
+
lumine admin identity list|status|use <zero|ciel|auto> [--json]
|
|
2501
|
+
lumine admin daily-run start [--identity zero|ciel|auto] [--comment-mode off|draft|post] [--run-key <key>] [--json]
|
|
2502
|
+
lumine admin daily-run status|complete|fail [--reason <text>] [--json]
|
|
2503
|
+
lumine admin recommendations list [--cursor <cursor>] [--json]
|
|
2504
|
+
lumine admin subjects candidates [--after <date>] [--effort unassigned] [--cursor <cursor>] [--json]
|
|
2505
|
+
lumine admin subject get|comments|reveal <subject-url-or-id> [--cursor <cursor>] [--json]
|
|
2506
|
+
lumine admin subject effort set <subject-id> --level <1|2|3> [--json]
|
|
2507
|
+
lumine admin subject creator set-made-by-poster <subject-id> [--json]
|
|
2508
|
+
lumine admin subject feature|unfeature <subject-id> [--json]
|
|
2509
|
+
lumine admin featured list|reorder --subject-ids <id,id,...> [--json]
|
|
2510
|
+
lumine admin post get|comments <target> [--type subject|comment|aiStory|dailyReflection] [--cursor <cursor>] [--json]
|
|
2511
|
+
lumine admin post recommend <target> [--type subject|comment|aiStory|dailyReflection] [--anyone-can-reward] [--reward-twinkles 3] [--json]
|
|
2512
|
+
lumine admin post reward <target> [--type subject|comment|aiStory|dailyReflection] --twinkles 3 [--json]
|
|
2513
|
+
lumine admin comment draft <subject-id> [--identity zero|ciel|auto] [--json]
|
|
2514
|
+
lumine admin comment post --draft-id <id> [--json]
|
|
2471
2515
|
|
|
2472
2516
|
Examples:
|
|
2473
2517
|
npx @stage5/lumine@latest
|
|
@@ -2509,6 +2553,11 @@ Examples:
|
|
|
2509
2553
|
npx @stage5/lumine@latest thumbnail capture --out capture.png
|
|
2510
2554
|
npx @stage5/lumine@latest thumbnail generate --model gpt-image-2 --yes
|
|
2511
2555
|
npx @stage5/lumine@latest doctor runtime-assets --build 917 --json
|
|
2556
|
+
npx @stage5/lumine@latest admin daily-run start --identity auto --comment-mode off --json
|
|
2557
|
+
npx @stage5/lumine@latest admin recommendations list --json
|
|
2558
|
+
npx @stage5/lumine@latest admin subjects candidates --effort unassigned --json
|
|
2559
|
+
npx @stage5/lumine@latest admin subject get 123 --include-comments --json
|
|
2560
|
+
npx @stage5/lumine@latest admin post recommend comment:456 --anyone-can-reward --reward-twinkles 3 --json
|
|
2512
2561
|
|
|
2513
2562
|
Options:
|
|
2514
2563
|
--api-url <url> Twinkle API origin
|
|
@@ -2526,6 +2575,21 @@ Options:
|
|
|
2526
2575
|
--summary <text> Save summary
|
|
2527
2576
|
--note <text> Message attached to a branch suggestion
|
|
2528
2577
|
--cursor <id> Continue an owner suggestion inbox listing
|
|
2578
|
+
--after <date> Admin subjects: inclusive Unix/ISO creation boundary
|
|
2579
|
+
--effort unassigned Admin subjects: show only unassigned effort
|
|
2580
|
+
--identity <mode> Admin identity: zero, ciel, or auto
|
|
2581
|
+
--comment-mode <mode> Admin run comments: off, draft, or post
|
|
2582
|
+
--run-key <key> Idempotency key for an admin daily run
|
|
2583
|
+
--idempotency-key <k> Stable retry key for one admin mutation
|
|
2584
|
+
--level <1|2|3> Admin subject effort level
|
|
2585
|
+
--subject-ids <ids> Complete ordered Featured subject IDs
|
|
2586
|
+
--type <type> Admin target: subject, comment, aiStory, or dailyReflection
|
|
2587
|
+
--kind recommend Admin recommendation queue kind
|
|
2588
|
+
--anyone-can-reward Enable canonical reward eligibility
|
|
2589
|
+
--reward-twinkles 3 Pair a recommendation with exactly 3 Twinkles
|
|
2590
|
+
--twinkles 3 Give exactly 3 Twinkles through the normal economy
|
|
2591
|
+
--draft-id <id> Canonical delegated comment draft ID
|
|
2592
|
+
--reason <text> Reason when marking an admin run failed
|
|
2529
2593
|
--force Overwrite server files even if this workspace is stale or missing filesHash
|
|
2530
2594
|
--search <text> Search public open-source Builds
|
|
2531
2595
|
--sort <sort> Sort open-source Builds: forks, popular, recent
|
|
@@ -2539,7 +2603,7 @@ Options:
|
|
|
2539
2603
|
--allow-write Permit sdk methods that mutate app data
|
|
2540
2604
|
--path <api/...> Call an sdk endpoint not in the curated list
|
|
2541
2605
|
--scopes <a,b> Override requested build API token scopes
|
|
2542
|
-
--json Print machine-readable output
|
|
2606
|
+
--json Print machine-readable output where supported
|
|
2543
2607
|
--keep-assets Keep doctor probe assets instead of deleting them
|
|
2544
2608
|
--no-browser Skip doctor browser probes
|
|
2545
2609
|
--model <model> Image model for generate: gpt-image-2 or nano-banana (required, no default)
|
package/lib/constants.js
CHANGED
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;
|