agent-deeplinks 0.1.27 → 0.1.29

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/README.md CHANGED
@@ -21,7 +21,7 @@ On npm 12, add `--allow-remote=root` when installing the tarball URL. [npm 12 in
21
21
  You can also download the ZIP from GitHub Releases and install its bundled npm tarball. The ZIP includes a static demo and the SVG files.
22
22
 
23
23
  ```sh
24
- npm install ./agent-deeplinks-0.1.27.tgz
24
+ npm install ./agent-deeplinks-0.1.29.tgz
25
25
  ```
26
26
 
27
27
  ## Usage
@@ -48,6 +48,8 @@ Use `getAgentLink("claude-code", "vscode", { prompt: "Review my changes." })` to
48
48
 
49
49
  For Claude and Claude Code web links, use `browserOnly: true` to keep the link in the browser on iOS. Leave it unset for the usual Universal Link handoff.
50
50
 
51
+ Claude Code Desktop accepts `folder` as an absolute local workspace path. It asks the user to confirm the folder before using it. [Claude Desktop deeplinks](https://support.claude.com/en/articles/14729294-open-claude-desktop-with-a-link)
52
+
51
53
  Claude Code Desktop also accepts `sshHost` with optional `sshPort` and `sshFolder`. Claude shows the target for review before use and keeps the prompt as an editable draft. This requires Desktop v2.110.0 or later and a signed-in account. [SSH deeplinks](https://code.claude.com/docs/en/desktop#open-an-ssh-session-from-a-link)
52
54
 
53
55
  ```ts
@@ -91,12 +93,16 @@ Kimi Code Desktop accepts a local `directory` and opens a fresh draft. Hosted Re
91
93
 
92
94
  Call `getAgentLink("openclaw", "desktop")` or choose `"ios"` to open the dashboard. With a connected Gateway, supplying a prompt opens OpenClaw's run confirmation.
93
95
  For the macOS [Add Gateway form](https://docs.openclaw.ai/platforms/mac/remote#open-the-mac-app-from-a-website), supply the Gateway HTTPS base address in `server`. The address can include a port and path. The user reviews it and chooses **Connect** in OpenClaw.
96
+ On iOS, pass a Gateway origin in `server` to stage the host, port, and TLS for review. Use HTTPS or WSS for TLS. HTTP and WS are limited to local hosts. Omitted ports use 443 for TLS and 18789 for plaintext. Enter credentials in the app if prompted. [iOS Gateway review](https://github.com/openclaw/openclaw/blob/v2026.11.8/apps/ios/Sources/Onboarding/OnboardingWizardView.swift#L938-L985)
94
97
  On Android, pass the configured Gateway address in `server` to open its Control UI in a browser.
95
98
 
96
99
  ```ts
97
100
  const gatewaySetup = getAgentLink("openclaw", "desktop", {
98
101
  server: "https://gateway.example.com/openclaw/",
99
102
  })
103
+ const mobileGatewaySetup = getAgentLink("openclaw", "ios", {
104
+ server: "https://gateway.example.com:18443",
105
+ })
100
106
  ```
101
107
 
102
108
  Use `getHermesSkillLink("official/security/1password")` or pass a direct skill URL to open Hermes Desktop's [skill install review](https://hermes-agent.nousresearch.com/docs/user-guide/features/skills#desktop-install-links). The signed macOS canary displayed the requested skill and destination before installation.
package/dist/catalog.d.ts CHANGED
@@ -20,6 +20,7 @@ export interface AgentRoute {
20
20
  readonly modes?: readonly string[];
21
21
  readonly encodeQueryValuesTwice?: boolean;
22
22
  readonly serverBehavior?: LinkBehavior;
23
+ readonly serverSource?: string;
23
24
  readonly promptLimit?: number;
24
25
  readonly promptLimitUnit?: "grapheme";
25
26
  readonly urlLimit?: number;
@@ -57,8 +58,8 @@ declare const catalog: {
57
58
  readonly url: "cursor://anysphere.cursor-deeplink/prompt";
58
59
  readonly evidence: "verified";
59
60
  readonly encodeQueryValuesTwice: true;
60
- readonly sources: readonly ["https://cursor.com/docs/reference/deeplinks", "https://github.com/lalalune/agent-deeplinks/actions/runs/45491150004/job/138789493816", "https://github.com/lalalune/agent-deeplinks/actions/runs/45491628951/job/138791208997", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460026095/job/138679769952", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460380555/job/138681026834", "https://github.com/lalalune/agent-deeplinks/actions/runs/45489023213/artifacts/14966850011"];
61
- readonly note: "Cursor 3.31.15 opened Create chat with prompt in the running classic editor on macOS and Ubuntu. The exact multiline Unicode text was visible in the Ubuntu window and reported by both renderers.";
61
+ readonly sources: readonly ["https://cursor.com/docs/reference/deeplinks", "https://github.com/lalalune/agent-deeplinks/actions/runs/45491150004/job/138789493816", "https://github.com/lalalune/agent-deeplinks/actions/runs/45491628951/job/138791208997", "https://github.com/lalalune/agent-deeplinks/actions/runs/45492105855/artifacts/14968450079", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460026095/job/138679769952", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460380555/job/138681026834", "https://github.com/lalalune/agent-deeplinks/actions/runs/45489023213/artifacts/14966850011"];
62
+ readonly note: "Cursor 3.31.15 opened Create chat with prompt in the running classic editor on macOS, Ubuntu, and Windows. All three renderers showed the exact multiline Unicode prompt.";
62
63
  readonly behavior: "confirm";
63
64
  readonly fields: {
64
65
  readonly prompt: "text";
@@ -70,7 +71,7 @@ declare const catalog: {
70
71
  readonly url: "https://cursor.com/agents";
71
72
  readonly behavior: "launch";
72
73
  readonly evidence: "source";
73
- readonly sources: readonly ["https://cursor.com/.well-known/apple-app-site-association", "https://cursor.com/docs/cloud-agent/mobile"];
74
+ readonly sources: readonly ["https://cursor.com/.well-known/apple-app-site-association", "https://cursor.com/docs/cloud-agent/mobile", "https://github.com/lalalune/agent-deeplinks/actions/runs/45493929967/artifacts/14966133706"];
74
75
  readonly note: "Universal Link for the Cursor Cloud Agents inbox. The iPhone browser fallback reached Cursor sign-in.";
75
76
  };
76
77
  readonly android: {
@@ -127,7 +128,7 @@ declare const catalog: {
127
128
  readonly url: "https://cursor.com/grok-bot/link/v1/prompt";
128
129
  readonly behavior: "handoff";
129
130
  readonly evidence: "verified";
130
- readonly sources: readonly ["https://docs.x.ai/grok-bot/deep-links", "https://github.com/lalalune/agent-deeplinks/actions/runs/45488932416/artifacts/14966115165"];
131
+ readonly sources: readonly ["https://docs.x.ai/grok-bot/deep-links", "https://github.com/lalalune/agent-deeplinks/actions/runs/45488932416/artifacts/14966115165", "https://github.com/lalalune/agent-deeplinks/actions/runs/45493929967/artifacts/14966133706"];
131
132
  readonly note: "The published Playground opened the native Grok Bot sign-in screen through stock Chrome on Ubuntu after the browser’s one-time approval. The mobile browser preview also produced the exact native URL.";
132
133
  readonly fields: {
133
134
  readonly prompt: "text";
@@ -381,7 +382,7 @@ declare const catalog: {
381
382
  readonly sshPort: "ssh_port";
382
383
  readonly sshFolder: "ssh_folder";
383
384
  };
384
- readonly note: "Prefill verified in Claude Desktop’s Code tab in 6.28899.6 on macOS. Windows and Ubuntu received the exact link and showed first-run onboarding. SSH fields require Desktop v2.110.0 or later and confirmation before use. The SSH flow is documented and its signed-in review remains unverified.";
385
+ readonly note: "Prefill verified in Claude Desktop’s Code tab in 6.28899.6 on macOS. Windows and Ubuntu received the exact link and showed first-run onboarding. Claude asks for confirmation before using a local folder or SSH target. SSH fields require Desktop v2.110.0 or later.";
385
386
  };
386
387
  readonly ios: {
387
388
  readonly url: "claude://code/new";
@@ -416,15 +417,15 @@ declare const catalog: {
416
417
  readonly cli: {
417
418
  readonly url: "claude-cli://open";
418
419
  readonly behavior: "draft";
419
- readonly evidence: "documented";
420
- readonly sources: readonly ["https://code.claude.com/docs/en/deep-links", "https://github.com/lalalune/agent-deeplinks/actions/runs/45488368601/artifacts/14965540998", "https://github.com/lalalune/agent-deeplinks/actions/runs/45487910168/artifacts/14964986411"];
420
+ readonly evidence: "verified";
421
+ readonly sources: readonly ["https://code.claude.com/docs/en/deep-links", "https://github.com/lalalune/agent-deeplinks/actions/runs/45488368601/artifacts/14965540998", "https://github.com/lalalune/agent-deeplinks/actions/runs/45487910168/artifacts/14964986411", "https://github.com/lalalune/agent-deeplinks/actions/runs/45499329278/artifacts/14969607471"];
421
422
  readonly fields: {
422
423
  readonly prompt: "q";
423
424
  readonly cwd: "cwd";
424
425
  readonly repo: "repo";
425
426
  };
426
427
  readonly promptLimit: 5000;
427
- readonly note: "Native launch delivered the exact prompt to Claude Code on macOS, Ubuntu, and Windows. Ubuntu and Windows opened the requested working directory. Signed-in terminal prefill remains unverified. cwd takes precedence over repo.";
428
+ readonly note: "Native handlers on macOS, Ubuntu, and Windows delivered the exact draft to Claude Code. Ubuntu's native terminal displayed it with the external-link warning using an isolated API gateway. Ubuntu and Windows opened the requested directory. cwd takes precedence over repo.";
428
429
  };
429
430
  readonly vscode: {
430
431
  readonly url: "vscode://anthropic.claude-code/open";
@@ -645,7 +646,7 @@ declare const catalog: {
645
646
  readonly url: "https://kimi.onelink.me/BZg1/";
646
647
  readonly behavior: "handoff";
647
648
  readonly evidence: "source";
648
- readonly sources: readonly ["https://kimi.onelink.me/.well-known/apple-app-site-association", "https://kimi.onelink.me/BZg1/"];
649
+ readonly sources: readonly ["https://kimi.onelink.me/.well-known/apple-app-site-association", "https://kimi.onelink.me/BZg1/", "https://github.com/lalalune/agent-deeplinks/actions/runs/45493929967/artifacts/14966133706"];
649
650
  readonly note: "Associated with Kimi for iOS. The browser fallback opens the App Store.";
650
651
  };
651
652
  readonly android: {
@@ -947,6 +948,7 @@ declare const catalog: {
947
948
  readonly server: "";
948
949
  };
949
950
  readonly serverBehavior: "confirm";
951
+ readonly serverSource: "https://docs.openclaw.ai/platforms/mac/remote#open-the-mac-app-from-a-website";
950
952
  readonly required: readonly ["prompt"];
951
953
  readonly launchUrl: "openclaw://dashboard";
952
954
  readonly promptLimit: 240;
@@ -957,15 +959,18 @@ declare const catalog: {
957
959
  readonly url: "openclaw://agent";
958
960
  readonly behavior: "confirm";
959
961
  readonly evidence: "verified";
960
- readonly sources: readonly ["https://github.com/openclaw/openclaw/blob/v2026.11.8/apps/ios/Sources/Model/NodeAppModel.swift", "https://github.com/lalalune/agent-deeplinks/actions/runs/45448771787/job/138639754996", "https://github.com/lalalune/agent-deeplinks/actions/runs/45454334627/job/138659607326", "https://github.com/lalalune/agent-deeplinks/actions/runs/45465579013/job/138699488297"];
962
+ readonly sources: readonly ["https://github.com/openclaw/openclaw/blob/v2026.11.8/apps/ios/Sources/Model/NodeAppModel.swift", "https://github.com/lalalune/agent-deeplinks/actions/runs/45448771787/job/138639754996", "https://github.com/lalalune/agent-deeplinks/actions/runs/45454334627/job/138659607326", "https://github.com/lalalune/agent-deeplinks/actions/runs/45465579013/job/138699488297", "https://github.com/openclaw/openclaw/blob/v2026.11.8/apps/ios/Sources/Onboarding/OnboardingWizardView.swift#L938-L985"];
961
963
  readonly fields: {
962
964
  readonly prompt: "message";
965
+ readonly server: "";
963
966
  };
967
+ readonly serverBehavior: "confirm";
968
+ readonly serverSource: "https://github.com/openclaw/openclaw/blob/v2026.11.8/apps/ios/Sources/Onboarding/OnboardingWizardView.swift#L938-L985";
964
969
  readonly required: readonly ["prompt"];
965
970
  readonly launchUrl: "openclaw://dashboard";
966
971
  readonly promptLimit: 240;
967
972
  readonly promptLimitUnit: "grapheme";
968
- readonly note: "The blank link opens native Overview. With a paired Gateway, the prompt link showed the exact message and Run confirmation in a source-built OpenClaw 2026.11.8 app on an iOS 27.2 simulator. App Store and physical device behavior remain unverified.";
973
+ readonly note: "The blank link opens native Overview. With a paired Gateway, the prompt link showed the exact message and Run confirmation in a source-built OpenClaw 2026.11.8 app on an iOS 27.2 simulator. A Gateway address stages the host, port, and TLS for review.";
969
974
  };
970
975
  readonly android: {
971
976
  readonly url: "http://127.0.0.1:18789/";
package/dist/catalog.js CHANGED
@@ -10,6 +10,8 @@ export const platformNames = {
10
10
  const cursorDocs = "https://cursor.com/docs/reference/deeplinks";
11
11
  const cursorCloudDocs = "https://cursor.com/docs/cloud-agent";
12
12
  const cursorCloud = "https://cursor.com/agents";
13
+ const openClawMacGatewaySource = "https://docs.openclaw.ai/platforms/mac/remote#open-the-mac-app-from-a-website";
14
+ const openClawIosGatewaySource = "https://github.com/openclaw/openclaw/blob/v2026.11.8/apps/ios/Sources/Onboarding/OnboardingWizardView.swift#L938-L985";
13
15
  const claudeCodeDocs = "https://code.claude.com/docs/en/deep-links";
14
16
  const claudeDesktopDocs = "https://support.claude.com/en/articles/14729294-open-claude-desktop-with-a-link";
15
17
  const claudeDesktopChecks = [
@@ -36,6 +38,7 @@ const slopDate = "https://slop.date/";
36
38
  const slopCash = "https://slop.cash/";
37
39
  const vibestack = "https://vibestack.fun/";
38
40
  const cursorIosAssociation = "https://cursor.com/.well-known/apple-app-site-association";
41
+ const iosAssociationCheck = "https://github.com/lalalune/agent-deeplinks/actions/runs/45493929967/artifacts/14966133706";
39
42
  const grokIosAssociation = "https://grok.com/.well-known/apple-app-site-association";
40
43
  const grokAndroidAssociation = "https://grok.com/.well-known/assetlinks.json";
41
44
  const geminiIos = "https://gemini.google.com/app/download/ios";
@@ -164,17 +167,18 @@ const catalog = {
164
167
  cursorDocs,
165
168
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45491150004/job/138789493816",
166
169
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45491628951/job/138791208997",
170
+ "https://github.com/lalalune/agent-deeplinks/actions/runs/45492105855/artifacts/14968450079",
167
171
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45460026095/job/138679769952",
168
172
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45460380555/job/138681026834",
169
173
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45489023213/artifacts/14966850011",
170
174
  ],
171
- note: "Cursor 3.31.15 opened Create chat with prompt in the running classic editor on macOS and Ubuntu. The exact multiline Unicode text was visible in the Ubuntu window and reported by both renderers.",
175
+ note: "Cursor 3.31.15 opened Create chat with prompt in the running classic editor on macOS, Ubuntu, and Windows. All three renderers showed the exact multiline Unicode prompt.",
172
176
  },
173
177
  ios: {
174
178
  url: cursorCloud,
175
179
  behavior: "launch",
176
180
  evidence: "source",
177
- sources: [cursorIosAssociation, "https://cursor.com/docs/cloud-agent/mobile"],
181
+ sources: [cursorIosAssociation, "https://cursor.com/docs/cloud-agent/mobile", iosAssociationCheck],
178
182
  note: "Universal Link for the Cursor Cloud Agents inbox. The iPhone browser fallback reached Cursor sign-in.",
179
183
  },
180
184
  android: {
@@ -228,7 +232,7 @@ const catalog = {
228
232
  url: "https://cursor.com/grok-bot/link/v1/prompt",
229
233
  behavior: "handoff",
230
234
  evidence: "verified",
231
- sources: [grokBotDocs, "https://github.com/lalalune/agent-deeplinks/actions/runs/45488932416/artifacts/14966115165"],
235
+ sources: [grokBotDocs, "https://github.com/lalalune/agent-deeplinks/actions/runs/45488932416/artifacts/14966115165", iosAssociationCheck],
232
236
  note: "The published Playground opened the native Grok Bot sign-in screen through stock Chrome on Ubuntu after the browser’s one-time approval. The mobile browser preview also produced the exact native URL.",
233
237
  },
234
238
  desktop: {
@@ -416,22 +420,23 @@ const catalog = {
416
420
  evidence: "verified",
417
421
  sources: [...claudeDesktopChecks, "https://code.claude.com/docs/en/desktop#open-an-ssh-session-from-a-link"],
418
422
  fields: { prompt: "q", folder: "folder", sshHost: "ssh_host", sshPort: "ssh_port", sshFolder: "ssh_folder" },
419
- note: "Prefill verified in Claude Desktop’s Code tab in 6.28899.6 on macOS. Windows and Ubuntu received the exact link and showed first-run onboarding. SSH fields require Desktop v2.110.0 or later and confirmation before use. The SSH flow is documented and its signed-in review remains unverified.",
423
+ note: "Prefill verified in Claude Desktop’s Code tab in 6.28899.6 on macOS. Windows and Ubuntu received the exact link and showed first-run onboarding. Claude asks for confirmation before using a local folder or SSH target. SSH fields require Desktop v2.110.0 or later.",
420
424
  },
421
425
  ios: claudeCodeMobileRoute,
422
426
  android: claudeCodeMobileRoute,
423
427
  cli: {
424
428
  url: "claude-cli://open",
425
429
  behavior: "draft",
426
- evidence: "documented",
430
+ evidence: "verified",
427
431
  sources: [
428
432
  claudeCodeDocs,
429
433
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45488368601/artifacts/14965540998",
430
434
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45487910168/artifacts/14964986411",
435
+ "https://github.com/lalalune/agent-deeplinks/actions/runs/45499329278/artifacts/14969607471",
431
436
  ],
432
437
  fields: { prompt: "q", cwd: "cwd", repo: "repo" },
433
438
  promptLimit: 5_000,
434
- note: "Native launch delivered the exact prompt to Claude Code on macOS, Ubuntu, and Windows. Ubuntu and Windows opened the requested working directory. Signed-in terminal prefill remains unverified. cwd takes precedence over repo.",
439
+ note: "Native handlers on macOS, Ubuntu, and Windows delivered the exact draft to Claude Code. Ubuntu's native terminal displayed it with the external-link warning using an isolated API gateway. Ubuntu and Windows opened the requested directory. cwd takes precedence over repo.",
435
440
  },
436
441
  vscode: {
437
442
  url: "vscode://anthropic.claude-code/open",
@@ -626,7 +631,7 @@ const catalog = {
626
631
  url: kimiMobile,
627
632
  behavior: "handoff",
628
633
  evidence: "source",
629
- sources: ["https://kimi.onelink.me/.well-known/apple-app-site-association", kimiMobile],
634
+ sources: ["https://kimi.onelink.me/.well-known/apple-app-site-association", kimiMobile, iosAssociationCheck],
630
635
  note: "Associated with Kimi for iOS. The browser fallback opens the App Store.",
631
636
  },
632
637
  android: {
@@ -846,11 +851,12 @@ const catalog = {
846
851
  "https://github.com/openclaw/openclaw/blob/v2026.11.7/apps/macos/Sources/OpenClaw/DeepLinks.swift",
847
852
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45473423005/job/138727187042",
848
853
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45476772927/job/138738941929",
849
- "https://docs.openclaw.ai/platforms/mac/remote#open-the-mac-app-from-a-website",
854
+ openClawMacGatewaySource,
850
855
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45491339853/job/138790178318",
851
856
  ],
852
857
  fields: { prompt: "message", server: "" },
853
858
  serverBehavior: "confirm",
859
+ serverSource: openClawMacGatewaySource,
854
860
  required: ["prompt"],
855
861
  launchUrl: "openclaw://dashboard",
856
862
  promptLimit: 240,
@@ -866,13 +872,16 @@ const catalog = {
866
872
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45448771787/job/138639754996",
867
873
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45454334627/job/138659607326",
868
874
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45465579013/job/138699488297",
875
+ openClawIosGatewaySource,
869
876
  ],
870
- fields: { prompt: "message" },
877
+ fields: { prompt: "message", server: "" },
878
+ serverBehavior: "confirm",
879
+ serverSource: openClawIosGatewaySource,
871
880
  required: ["prompt"],
872
881
  launchUrl: "openclaw://dashboard",
873
882
  promptLimit: 240,
874
883
  promptLimitUnit: "grapheme",
875
- note: "The blank link opens native Overview. With a paired Gateway, the prompt link showed the exact message and Run confirmation in a source-built OpenClaw 2026.11.8 app on an iOS 27.2 simulator. App Store and physical device behavior remain unverified.",
884
+ note: "The blank link opens native Overview. With a paired Gateway, the prompt link showed the exact message and Run confirmation in a source-built OpenClaw 2026.11.8 app on an iOS 27.2 simulator. A Gateway address stages the host, port, and TLS for review.",
876
885
  },
877
886
  android: {
878
887
  url: "http://127.0.0.1:18789/",
package/dist/index.js CHANGED
@@ -21,6 +21,49 @@ function parseServerUrl(value) {
21
21
  return null;
22
22
  }
23
23
  }
24
+ function isOpenClawLocalHost(hostname) {
25
+ // Apply OpenClaw's plaintext policy to the canonical hostname returned by URL.
26
+ const host = hostname.replace(/\.$/u, "");
27
+ if (["localhost", "0.0.0.0", "::", "::1"].includes(host) || host.endsWith(".local"))
28
+ return true;
29
+ if (/^(?:f[cd][\da-f]{2}:|fe[89ab][\da-f]:|::ffff:7f[\da-f]{2}:)/u.test(host))
30
+ return true;
31
+ if (!/^(?:\d{1,3}\.){3}\d{1,3}$/u.test(host))
32
+ return false;
33
+ const [first, second = 0] = host.split(".").map(Number);
34
+ return first === 10 || first === 127 || (first === 192 && second === 168) ||
35
+ (first === 169 && second === 254) || (first === 172 && second >= 16 && second <= 31);
36
+ }
37
+ function getOpenClawGatewayLink(address, platform) {
38
+ const match = /^(?:https?|wss?):\/\/([^/\s@\\?#]+)(\/[^\\?#]*)?$/iu.exec(address);
39
+ if (!match || hiddenPathCharacters.test(address))
40
+ return null;
41
+ let gateway;
42
+ try {
43
+ gateway = new URL(address);
44
+ }
45
+ catch {
46
+ return null;
47
+ }
48
+ if (gateway.port === "0")
49
+ return null;
50
+ if (platform === "desktop") {
51
+ return gateway.protocol === "https:"
52
+ ? `openclaw://gateway/add?url=${encodeURIComponent(gateway.href)}`
53
+ : null;
54
+ }
55
+ const [, authority = "", path] = match;
56
+ if (path && path !== "/")
57
+ return null;
58
+ const tls = gateway.protocol === "https:" || gateway.protocol === "wss:";
59
+ const host = gateway.hostname.replace(/^\[|\]$/gu, "");
60
+ if (!tls && !isOpenClawLocalHost(host))
61
+ return null;
62
+ // The URL parser removes an explicit default scheme port, which the native setup form still needs.
63
+ const explicitPort = /:(\d+)$/u.exec(authority)?.[1];
64
+ const port = explicitPort === undefined ? (tls ? 443 : 18789) : Number(explicitPort);
65
+ return `openclaw://gateway?host=${encodeURIComponent(host)}&port=${port}&tls=${tls ? 1 : 0}`;
66
+ }
24
67
  function getOpenCodeOrigin(url) {
25
68
  const local = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
26
69
  return url.pathname === "/" && (url.protocol === "https:" || local) ? url.origin : null;
@@ -135,14 +178,8 @@ export function getAgentLink(agent, platform, options = {}) {
135
178
  if ((route.experimental && !options.allowExperimental) ||
136
179
  (route.behavior === "send" && !options.allowSend))
137
180
  return null;
138
- if (agent === "openclaw" && platform === "desktop" && fields.server) {
139
- if (fields.prompt || hiddenPathCharacters.test(fields.server) ||
140
- !/^https:\/\/[^/\s@\\?#]+(?:\/[^\\?#]*)?$/iu.test(fields.server))
141
- return null;
142
- const gateway = parseServerUrl(fields.server);
143
- return gateway && gateway.port !== "0"
144
- ? `openclaw://gateway/add?url=${encodeURIComponent(gateway.href)}`
145
- : null;
181
+ if (agent === "openclaw" && (platform === "desktop" || platform === "ios") && fields.server) {
182
+ return fields.prompt ? null : getOpenClawGatewayLink(fields.server, platform);
146
183
  }
147
184
  if (route.required?.some((field) => !fields[field]?.trim()))
148
185
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-deeplinks",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "Evidence-backed deep links for AI agents with SVG icons and React helpers.",
5
5
  "type": "module",
6
6
  "license": "MIT",