usebeeline 0.1.21 → 0.1.22
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/usebeeline.mjs +32 -1
- package/package.json +1 -1
package/dist/usebeeline.mjs
CHANGED
|
@@ -13722,7 +13722,38 @@ function squireApprovalFromMcp(request, response) {
|
|
|
13722
13722
|
if (!link2)
|
|
13723
13723
|
return void 0;
|
|
13724
13724
|
const args = record(params?.arguments) ?? {};
|
|
13725
|
-
|
|
13725
|
+
const expiresAt = approvalExpiryIn(response.result);
|
|
13726
|
+
return {
|
|
13727
|
+
tool,
|
|
13728
|
+
...squireApprovalCopy(tool, args),
|
|
13729
|
+
...link2,
|
|
13730
|
+
...expiresAt !== void 0 ? { expiresAt } : {}
|
|
13731
|
+
};
|
|
13732
|
+
}
|
|
13733
|
+
function approvalExpiryIn(value, depth = 0) {
|
|
13734
|
+
if (depth > 6)
|
|
13735
|
+
return void 0;
|
|
13736
|
+
if (typeof value === "string") {
|
|
13737
|
+
if (value.length > 2e4 || !/^[{[]/.test(value.trim()))
|
|
13738
|
+
return void 0;
|
|
13739
|
+
try {
|
|
13740
|
+
return approvalExpiryIn(JSON.parse(value), depth + 1);
|
|
13741
|
+
} catch {
|
|
13742
|
+
return void 0;
|
|
13743
|
+
}
|
|
13744
|
+
}
|
|
13745
|
+
if (Array.isArray(value))
|
|
13746
|
+
return value.map((entry) => approvalExpiryIn(entry, depth + 1)).find((expiry) => expiry !== void 0);
|
|
13747
|
+
const item = record(value);
|
|
13748
|
+
if (!item)
|
|
13749
|
+
return void 0;
|
|
13750
|
+
const raw = item.expires_at ?? item.expiresAt;
|
|
13751
|
+
if (typeof raw === "string") {
|
|
13752
|
+
const parsed = Date.parse(raw);
|
|
13753
|
+
if (Number.isFinite(parsed) && parsed > 0)
|
|
13754
|
+
return parsed;
|
|
13755
|
+
}
|
|
13756
|
+
return Object.values(item).map((entry) => approvalExpiryIn(entry, depth + 1)).find((expiry) => expiry !== void 0);
|
|
13726
13757
|
}
|
|
13727
13758
|
function squireLoginWallIn(value, depth = 0) {
|
|
13728
13759
|
if (depth > 6)
|