@lobehub/cli 0.0.207 → 0.0.209
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/dist/acceptance-report.html +264 -264
- package/dist/index.js +47 -17
- package/man/man1/lh.1 +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -41610,26 +41610,56 @@ function withEvidenceUploadOptions(cmd) {
|
|
|
41610
41610
|
|
|
41611
41611
|
//#endregion
|
|
41612
41612
|
//#region src/commands/acceptance/run/report.ts
|
|
41613
|
+
/**
|
|
41614
|
+
* What a run can do once its operation token is refused on `report upsert`.
|
|
41615
|
+
*
|
|
41616
|
+
* The refusal is deliberate: the report carries the round's verdict, so the
|
|
41617
|
+
* round's verifier writes it, and `upsertReport` stays off the operation-token
|
|
41618
|
+
* allowlist. A token without `acceptance:evidence` is refused one step earlier,
|
|
41619
|
+
* on the language check's `user.getUserState`, and is no closer to writing it.
|
|
41620
|
+
* A same-account stored login has already been tried by the time the refusal
|
|
41621
|
+
* reaches the command (`operationTokenFallbackLink`), so it is final; a bare
|
|
41622
|
+
* 401 only got retried. The commands below take the run's own operation id,
|
|
41623
|
+
* which the token is bound to.
|
|
41624
|
+
*/
|
|
41625
|
+
const reportRefusalGuidance = (runId) => {
|
|
41626
|
+
const operation = process.env.LOBEHUB_OPERATION_ID || "<operationId>";
|
|
41627
|
+
return [
|
|
41628
|
+
`This run's token cannot write the report of round ${runId}: a round's report and verdict are written by that round's verifier.`,
|
|
41629
|
+
` Check for a plan round: lh acceptance plan state ${operation} (it has one when "confirmed" shows a time).`,
|
|
41630
|
+
" With a plan round, hand in evidence instead:",
|
|
41631
|
+
` lh acceptance run ingest <reportDir> --operation ${operation}`,
|
|
41632
|
+
` lh acceptance run result submit --operation ${operation} --item <checkItemId> --type <type> --file <path>`,
|
|
41633
|
+
" Without one, or if that check is refused too, report the handoff as blocked. Do not retry report upsert."
|
|
41634
|
+
];
|
|
41635
|
+
};
|
|
41613
41636
|
async function reportUpsertAction(options) {
|
|
41614
41637
|
const num = (s) => s === void 0 ? void 0 : Number.parseInt(s, 10);
|
|
41615
41638
|
const client = await getTrpcClient();
|
|
41616
|
-
|
|
41617
|
-
|
|
41618
|
-
|
|
41619
|
-
|
|
41620
|
-
|
|
41621
|
-
|
|
41622
|
-
|
|
41623
|
-
|
|
41624
|
-
|
|
41625
|
-
|
|
41626
|
-
|
|
41627
|
-
|
|
41628
|
-
|
|
41629
|
-
|
|
41630
|
-
|
|
41631
|
-
|
|
41632
|
-
|
|
41639
|
+
let created;
|
|
41640
|
+
try {
|
|
41641
|
+
await assertReportLanguage(client, [{
|
|
41642
|
+
path: "--summary",
|
|
41643
|
+
text: options.summary
|
|
41644
|
+
}, {
|
|
41645
|
+
path: "--content",
|
|
41646
|
+
text: options.content
|
|
41647
|
+
}]);
|
|
41648
|
+
created = await client.verify.upsertReport.mutate({
|
|
41649
|
+
content: options.content,
|
|
41650
|
+
failedChecks: num(options.failed),
|
|
41651
|
+
passedChecks: num(options.passed),
|
|
41652
|
+
summary: options.summary,
|
|
41653
|
+
totalChecks: num(options.total),
|
|
41654
|
+
uncertainChecks: num(options.uncertain),
|
|
41655
|
+
verdict: options.verdict,
|
|
41656
|
+
verifyRunId: options.run
|
|
41657
|
+
});
|
|
41658
|
+
} catch (error) {
|
|
41659
|
+
if (!isOperationTokenRefusal(error)) throw error;
|
|
41660
|
+
for (const line of reportRefusalGuidance(options.run)) log$15.error(line);
|
|
41661
|
+
process.exit(1);
|
|
41662
|
+
}
|
|
41633
41663
|
if (options.json !== void 0) {
|
|
41634
41664
|
outputJson(created, typeof options.json === "string" ? options.json : void 0);
|
|
41635
41665
|
return;
|
package/man/man1/lh.1
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.\" Code generated by `npm run man:generate`; DO NOT EDIT.
|
|
2
2
|
.\" Manual command details come from the Commander command tree.
|
|
3
|
-
.TH LH 1 "" "@lobehub/cli 0.0.
|
|
3
|
+
.TH LH 1 "" "@lobehub/cli 0.0.209" "User Commands"
|
|
4
4
|
.SH NAME
|
|
5
5
|
lh \- LobeHub CLI \- manage and connect to LobeHub services
|
|
6
6
|
.SH SYNOPSIS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.209",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/lobehub/lobehub",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"access": "public",
|
|
84
84
|
"registry": "https://registry.npmjs.org"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "412cf3d6ca979ce12cd6044e5aeb276fd33ddbb9"
|
|
87
87
|
}
|