@stage5/lumine 0.2.18 → 0.2.20
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 +890 -0
- package/lib/commands.js +75 -2
- package/lib/constants.js +1 -0
- package/lib/http.js +4 -1
- package/package.json +1 -1
- package/sdk/LUMINE_ADMIN.md +907 -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,9 @@ export function parseArgs(args) {
|
|
|
2088
2094
|
"json",
|
|
2089
2095
|
"keepAssets",
|
|
2090
2096
|
"noBrowser",
|
|
2097
|
+
"includeComments",
|
|
2098
|
+
"anyoneCanReward",
|
|
2099
|
+
"full",
|
|
2091
2100
|
]);
|
|
2092
2101
|
|
|
2093
2102
|
for (let i = 0; i < rest.length; i += 1) {
|
|
@@ -2156,6 +2165,32 @@ export function parseArgs(args) {
|
|
|
2156
2165
|
: ""),
|
|
2157
2166
|
).trim() || "",
|
|
2158
2167
|
cursor: Math.max(0, Math.floor(Number(raw.cursor) || 0)),
|
|
2168
|
+
adminCursor: raw.cursor ? String(raw.cursor) : "",
|
|
2169
|
+
adminAfter: raw.after ? String(raw.after) : "",
|
|
2170
|
+
adminEffort: raw.effort ? String(raw.effort) : "",
|
|
2171
|
+
adminLevel: raw.level ? String(raw.level) : "",
|
|
2172
|
+
adminIds: raw.subjectIds
|
|
2173
|
+
? String(raw.subjectIds)
|
|
2174
|
+
: raw.ids
|
|
2175
|
+
? String(raw.ids)
|
|
2176
|
+
: "",
|
|
2177
|
+
adminType: raw.type ? String(raw.type) : "",
|
|
2178
|
+
adminKind: raw.kind ? String(raw.kind) : "",
|
|
2179
|
+
adminContentTypes: raw.contentTypes ? String(raw.contentTypes) : "",
|
|
2180
|
+
adminIdentity: raw.identity ? String(raw.identity) : "",
|
|
2181
|
+
commentMode: raw.commentMode ? String(raw.commentMode) : "",
|
|
2182
|
+
runKey: raw.runKey ? String(raw.runKey) : "",
|
|
2183
|
+
idempotencyKey: raw.idempotencyKey ? String(raw.idempotencyKey) : "",
|
|
2184
|
+
draftId: raw.draftId ? String(raw.draftId) : "",
|
|
2185
|
+
twinkles: raw.twinkles ? String(raw.twinkles) : "",
|
|
2186
|
+
adminReason: raw.reason ? String(raw.reason) : "",
|
|
2187
|
+
adminRun: raw.run ? String(raw.run) : "",
|
|
2188
|
+
adminTarget: raw.target ? String(raw.target) : "",
|
|
2189
|
+
adminActions: raw.actions ? String(raw.actions) : "",
|
|
2190
|
+
adminFull: parseBoolean(raw.full, false),
|
|
2191
|
+
rewardTwinkles: raw.rewardTwinkles ? String(raw.rewardTwinkles) : "",
|
|
2192
|
+
includeComments: parseBoolean(raw.includeComments, false),
|
|
2193
|
+
anyoneCanReward: parseBoolean(raw.anyoneCanReward, false),
|
|
2159
2194
|
repeat: Math.min(Math.max(Math.floor(Number(raw.repeat) || 1), 1), 20),
|
|
2160
2195
|
allowWrite: parseBoolean(raw.allowWrite, false),
|
|
2161
2196
|
assumeYes: parseBoolean(raw.yes, false),
|
|
@@ -2468,6 +2503,24 @@ export function printHelp() {
|
|
|
2468
2503
|
lumine thumbnail capture [--out <file>]
|
|
2469
2504
|
lumine thumbnail generate ["<prompt>"] --model <gpt-image-2|nano-banana>
|
|
2470
2505
|
lumine doctor runtime-assets
|
|
2506
|
+
lumine admin identity list|status|use <zero|ciel|auto> [--json]
|
|
2507
|
+
lumine admin daily-run start [--identity zero|ciel|auto] [--comment-mode off|draft|post] [--run-key <key>] [--json]
|
|
2508
|
+
lumine admin daily-run status|complete|fail [--reason <text>] [--json]
|
|
2509
|
+
lumine admin recommendations list [--content-types comment,dailyReflection] [--cursor <cursor>] [--json]
|
|
2510
|
+
lumine admin subjects candidates [--after <date>] [--effort unassigned] [--cursor <cursor>] [--json]
|
|
2511
|
+
lumine admin subject get|comments|reveal <subject-url-or-id> [--cursor <cursor>] [--json]
|
|
2512
|
+
lumine admin subject effort set <subject-id> --level <1|2|3> [--json]
|
|
2513
|
+
lumine admin subject creator set-made-by-poster <subject-id> [--json]
|
|
2514
|
+
lumine admin subject feature|unfeature <subject-id> [--json]
|
|
2515
|
+
lumine admin featured list|reorder --subject-ids <id,id,...> [--json]
|
|
2516
|
+
lumine admin post get|comments <target> [--type subject|comment|aiStory|dailyReflection] [--cursor <cursor>] [--json]
|
|
2517
|
+
lumine admin post recommend <target> [--type subject|comment|aiStory|dailyReflection] [--anyone-can-reward] [--reward-twinkles 3] [--json]
|
|
2518
|
+
lumine admin post skip <target> [--type comment|aiStory|dailyReflection] [--reason <text>] [--json]
|
|
2519
|
+
lumine admin post reward <target> [--type subject|comment|aiStory|dailyReflection] --twinkles 3 [--json]
|
|
2520
|
+
lumine admin comment draft <target> [--type subject|comment|aiStory|dailyReflection] [--identity zero|ciel|auto] [--json]
|
|
2521
|
+
lumine admin comment reply comment:<id> [--identity zero|ciel|auto] [--json]
|
|
2522
|
+
lumine admin comment post --draft-id <id> [--json]
|
|
2523
|
+
lumine admin audit [list] [--run current|last|<run-id>] [--target <target>] [--actions <a,b>] [--full] [--cursor <cursor>] [--json]
|
|
2471
2524
|
|
|
2472
2525
|
Examples:
|
|
2473
2526
|
npx @stage5/lumine@latest
|
|
@@ -2509,6 +2562,11 @@ Examples:
|
|
|
2509
2562
|
npx @stage5/lumine@latest thumbnail capture --out capture.png
|
|
2510
2563
|
npx @stage5/lumine@latest thumbnail generate --model gpt-image-2 --yes
|
|
2511
2564
|
npx @stage5/lumine@latest doctor runtime-assets --build 917 --json
|
|
2565
|
+
npx @stage5/lumine@latest admin daily-run start --identity auto --comment-mode off --json
|
|
2566
|
+
npx @stage5/lumine@latest admin recommendations list --json
|
|
2567
|
+
npx @stage5/lumine@latest admin subjects candidates --effort unassigned --json
|
|
2568
|
+
npx @stage5/lumine@latest admin subject get 123 --include-comments --json
|
|
2569
|
+
npx @stage5/lumine@latest admin post recommend comment:456 --anyone-can-reward --reward-twinkles 3 --json
|
|
2512
2570
|
|
|
2513
2571
|
Options:
|
|
2514
2572
|
--api-url <url> Twinkle API origin
|
|
@@ -2526,6 +2584,21 @@ Options:
|
|
|
2526
2584
|
--summary <text> Save summary
|
|
2527
2585
|
--note <text> Message attached to a branch suggestion
|
|
2528
2586
|
--cursor <id> Continue an owner suggestion inbox listing
|
|
2587
|
+
--after <date> Admin subjects: inclusive Unix/ISO creation boundary
|
|
2588
|
+
--effort unassigned Admin subjects: show only unassigned effort
|
|
2589
|
+
--identity <mode> Admin identity: zero, ciel, or auto
|
|
2590
|
+
--comment-mode <mode> Admin run comments: off, draft, or post
|
|
2591
|
+
--run-key <key> Idempotency key for an admin daily run
|
|
2592
|
+
--idempotency-key <k> Stable retry key for one admin mutation
|
|
2593
|
+
--level <1|2|3> Admin subject effort level
|
|
2594
|
+
--subject-ids <ids> Complete ordered Featured subject IDs
|
|
2595
|
+
--type <type> Admin target: subject, comment, aiStory, or dailyReflection
|
|
2596
|
+
--kind recommend Admin recommendation queue kind
|
|
2597
|
+
--anyone-can-reward Enable canonical reward eligibility
|
|
2598
|
+
--reward-twinkles 3 Pair a recommendation with exactly 3 Twinkles
|
|
2599
|
+
--twinkles 3 Give exactly 3 Twinkles through the normal economy
|
|
2600
|
+
--draft-id <id> Canonical delegated comment draft ID
|
|
2601
|
+
--reason <text> Reason when marking an admin run failed
|
|
2529
2602
|
--force Overwrite server files even if this workspace is stale or missing filesHash
|
|
2530
2603
|
--search <text> Search public open-source Builds
|
|
2531
2604
|
--sort <sort> Sort open-source Builds: forks, popular, recent
|
|
@@ -2539,7 +2612,7 @@ Options:
|
|
|
2539
2612
|
--allow-write Permit sdk methods that mutate app data
|
|
2540
2613
|
--path <api/...> Call an sdk endpoint not in the curated list
|
|
2541
2614
|
--scopes <a,b> Override requested build API token scopes
|
|
2542
|
-
--json Print machine-readable output
|
|
2615
|
+
--json Print machine-readable output where supported
|
|
2543
2616
|
--keep-assets Keep doctor probe assets instead of deleting them
|
|
2544
2617
|
--no-browser Skip doctor browser probes
|
|
2545
2618
|
--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;
|