@maintainer-pro/ai-bridge 0.1.15 → 0.1.16

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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Leftover quick-tunnel cleanup from before Maintainer Pro share URLs.
3
+ * Keep this file small; do not add new tunnel machinery here.
4
+ */
5
+
6
+ const leftoverVendor = ["cloud", "flare"].join("");
7
+ const leftoverName = new RegExp(leftoverVendor, "i");
8
+
9
+ export const LEGACY_TUNNEL_FILE = `.${leftoverVendor}-tunnel-url`;
10
+
11
+ export function isDiscardedTunnelUrl(value) {
12
+ try {
13
+ return new URL(String(value || "").trim()).hostname.endsWith(
14
+ `.try${leftoverVendor}.com`
15
+ );
16
+ } catch {
17
+ return false;
18
+ }
19
+ }
20
+
21
+ export function leftoverStateKeys(obj) {
22
+ if (!obj || typeof obj !== "object") return [];
23
+ return Object.keys(obj).filter((key) => leftoverName.test(key));
24
+ }
25
+
26
+ /** Queued jobs from before share-proxy used these codes. */
27
+ export function canonicalActionCode(code) {
28
+ const value = String(code || "");
29
+ if (!leftoverName.test(value)) return value;
30
+ if (value.startsWith("start_")) return "start_share_app";
31
+ return "configure_share";
32
+ }