@lobehub/cli 0.0.207 → 0.0.208

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/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
- await assertReportLanguage(client, [{
41617
- path: "--summary",
41618
- text: options.summary
41619
- }, {
41620
- path: "--content",
41621
- text: options.content
41622
- }]);
41623
- const created = await client.verify.upsertReport.mutate({
41624
- content: options.content,
41625
- failedChecks: num(options.failed),
41626
- passedChecks: num(options.passed),
41627
- summary: options.summary,
41628
- totalChecks: num(options.total),
41629
- uncertainChecks: num(options.uncertain),
41630
- verdict: options.verdict,
41631
- verifyRunId: options.run
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.207" "User Commands"
3
+ .TH LH 1 "" "@lobehub/cli 0.0.208" "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.207",
3
+ "version": "0.0.208",
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": "2d1bf9b34312f5bcc06a275ac1e9d3dcabd743cb"
86
+ "gitHead": "35afe8b2773a5b79ff766b383c0f9020a18ab11f"
87
87
  }