@lobehub/cli 0.0.100 → 0.0.101

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
@@ -26567,6 +26567,15 @@ const subjectOf = (token) => {
26567
26567
  return typeof sub === "string" && sub ? sub : void 0;
26568
26568
  };
26569
26569
  const isOperationTokenRefusal = (error) => isTRPCClientError(error) && error.data?.code === "UNAUTHORIZED" && error.message === "hetero-operation tokens are not accepted on this endpoint";
26570
+ /** A library destination cannot be filed as run-scoped evidence. The refusal
26571
+ * happens before createFile writes, so it can use the same one-shot, same-owner
26572
+ * fallback as a user-scoped endpoint. Never retry a general permission denial.
26573
+ */
26574
+ const isLibraryUploadRefusal = (op, error) => {
26575
+ if (op.path !== "file.createFile" || !isTRPCClientError(error) || error.data?.code !== "FORBIDDEN" || !["This run's token can only upload acceptance evidence", "This run's token can only upload acceptance evidence or tool-result images"].includes(error.message)) return false;
26576
+ const input = op.input;
26577
+ return [input?.knowledgeBaseId, input?.parentId].some((id) => typeof id === "string" && id.length > 0);
26578
+ };
26570
26579
  /**
26571
26580
  * The stored login, when it is usable and belongs to the operation token's own
26572
26581
  * account.
@@ -26591,7 +26600,7 @@ const operationTokenFallbackLink = (operationToken) => () => ({ next, op }) => o
26591
26600
  let subscription = next(op).subscribe({
26592
26601
  complete: () => observer.complete(),
26593
26602
  error: (error) => {
26594
- if (op.context[STORED_LOGIN] || !isOperationTokenRefusal(error)) {
26603
+ if (op.context[STORED_LOGIN] || !isOperationTokenRefusal(error) && !isLibraryUploadRefusal(op, error)) {
26595
26604
  observer.error(error);
26596
26605
  return;
26597
26606
  }
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.100" "User Commands"
3
+ .TH LH 1 "" "@lobehub/cli 0.0.101" "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.100",
3
+ "version": "0.0.101",
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": "2f545ce5a8683643763d5cc745356f47eafe7579"
86
+ "gitHead": "f67d90ee35641601b7d2ff0dbfe72268853f9dc2"
87
87
  }