agent-deeplinks 0.1.23 → 0.1.25

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.23.tgz
24
+ npm install ./agent-deeplinks-0.1.25.tgz
25
25
  ```
26
26
 
27
27
  ## Usage
@@ -46,6 +46,17 @@ Use `getAgentLink("claude-code", "vscode", { prompt: "Review my changes." })` to
46
46
 
47
47
  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.
48
48
 
49
+ 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)
50
+
51
+ ```ts
52
+ const remoteDraft = getAgentLink("claude-code", "desktop", {
53
+ sshHost: "dev@build.example.com",
54
+ sshPort: "2222",
55
+ sshFolder: "~/project",
56
+ prompt: "Review the build logs.",
57
+ })
58
+ ```
59
+
49
60
  GitHub Copilot Desktop can open a draft with a prompt, an `owner/repo` repository, or a custom agent. The Web option wraps draft links in GitHub’s hosted launcher. Choose `vscode` to open the VS Code Agents window with a prompt and an optional `workspace` folder URI.
50
61
 
51
62
  ```ts
package/dist/catalog.d.ts CHANGED
@@ -3,7 +3,7 @@ export type Platform = (typeof platforms)[number];
3
3
  export declare const platformNames: Readonly<Record<Platform, string>>;
4
4
  export type Evidence = "documented" | "source" | "observed" | "verified";
5
5
  export type LinkBehavior = "draft" | "launch" | "handoff" | "confirm" | "send" | "unknown";
6
- export type LinkField = "prompt" | "cwd" | "repo" | "path" | "originUrl" | "directory" | "provider" | "model" | "botId" | "folder" | "server" | "mode" | "branch" | "session" | "pr" | "customAgent" | "workspace";
6
+ export type LinkField = "prompt" | "cwd" | "repo" | "path" | "originUrl" | "directory" | "provider" | "model" | "botId" | "folder" | "server" | "mode" | "branch" | "session" | "pr" | "customAgent" | "workspace" | "sshHost" | "sshPort" | "sshFolder";
7
7
  export interface AgentRoute {
8
8
  readonly url: string;
9
9
  readonly behavior: LinkBehavior;
@@ -137,8 +137,8 @@ declare const catalog: {
137
137
  readonly urlLimit: 2048;
138
138
  };
139
139
  readonly desktop: {
140
- readonly sources: readonly ["https://docs.x.ai/grok-bot/deep-links", "https://docs.x.ai/grok-bot/get-started", "https://github.com/lalalune/agent-deeplinks/actions/runs/45461984963/job/138686754025", "https://github.com/lalalune/agent-deeplinks/actions/runs/45461984963/job/138686754337"];
141
- readonly note: "Stock Ubuntu and Windows apps received the exact link and opened at sign-in. Drafts require a signed-in eligible account and use the primary Bot unless you supply a Bot ID.";
140
+ readonly sources: readonly ["https://docs.x.ai/grok-bot/deep-links", "https://docs.x.ai/grok-bot/get-started", "https://github.com/lalalune/agent-deeplinks/actions/runs/45483518818/artifacts/14964275753", "https://github.com/lalalune/agent-deeplinks/actions/runs/45461984963/job/138686754025", "https://github.com/lalalune/agent-deeplinks/actions/runs/45461984963/job/138686754337"];
141
+ readonly note: "LaunchServices started the signed Grok Bot 1.3.0 app on macOS. Stock Ubuntu and Windows apps received the exact link and opened at sign-in. Drafts require an eligible account and use the primary Bot unless you supply a Bot ID.";
142
142
  readonly url: "grokbot://app/v1/prompt";
143
143
  readonly behavior: "draft";
144
144
  readonly evidence: "documented";
@@ -282,10 +282,10 @@ declare const catalog: {
282
282
  };
283
283
  readonly desktop: {
284
284
  readonly url: "https://agent.meta.ai/chat";
285
- readonly behavior: "launch";
285
+ readonly behavior: "handoff";
286
286
  readonly evidence: "verified";
287
- readonly sources: readonly ["https://agent.meta.ai/.well-known/apple-app-site-association", "https://github.com/lalalune/agent-deeplinks/actions/runs/45450575543/job/138646218114", "https://github.com/lalalune/agent-deeplinks/actions/runs/45480862958/job/138753307658"];
288
- readonly note: "On macOS, this Universal Link selected Muse 13.1 after the app's first launch and domain approval. Fresh installations can open Safari while macOS verifies the domain.";
287
+ readonly sources: readonly ["https://agent.meta.ai/.well-known/apple-app-site-association", "https://github.com/lalalune/agent-deeplinks/actions/runs/45480862958/job/138753307658", "https://github.com/lalalune/agent-deeplinks/actions/runs/45483440516/artifacts/14962696263"];
288
+ readonly note: "Ordinary macOS URL opening selected Muse 13.1 after its first launch and domain approval. A click in stock Chrome 157 reached the Muse website and its sign-in page.";
289
289
  };
290
290
  readonly ios: {
291
291
  readonly url: "https://applink.muse.ai/";
@@ -372,12 +372,15 @@ declare const catalog: {
372
372
  readonly url: "claude://code/new";
373
373
  readonly behavior: "draft";
374
374
  readonly evidence: "verified";
375
- readonly sources: readonly ["https://support.claude.com/en/articles/14729294-open-claude-desktop-with-a-link", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460279575/job/138680666371", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460279575/job/138680666686"];
375
+ readonly sources: readonly ["https://support.claude.com/en/articles/14729294-open-claude-desktop-with-a-link", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460279575/job/138680666371", "https://github.com/lalalune/agent-deeplinks/actions/runs/45460279575/job/138680666686", "https://code.claude.com/docs/en/desktop#open-an-ssh-session-from-a-link"];
376
376
  readonly fields: {
377
377
  readonly prompt: "q";
378
378
  readonly folder: "folder";
379
+ readonly sshHost: "ssh_host";
380
+ readonly sshPort: "ssh_port";
381
+ readonly sshFolder: "ssh_folder";
379
382
  };
380
- 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. Signed-in composers on those platforms still need verification.";
383
+ 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.";
381
384
  };
382
385
  readonly ios: {
383
386
  readonly url: "claude://code/new";
@@ -427,11 +430,12 @@ declare const catalog: {
427
430
  readonly launchUrl: "vscode://anthropic.claude-code/open";
428
431
  readonly behavior: "draft";
429
432
  readonly evidence: "documented";
430
- readonly sources: readonly ["https://code.claude.com/docs/en/vs-code#launch-a-vs-code-tab-from-other-tools", "https://code.claude.com/docs/en/deep-links", "https://github.com/lalalune/agent-deeplinks/actions/runs/45454069271/job/138658637744"];
433
+ readonly sources: readonly ["https://code.claude.com/docs/en/vs-code#launch-a-vs-code-tab-from-other-tools", "https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code", "https://github.com/microsoft/vscode/blob/8a14f0cc1b08d531eb83255ea3764ae22aa932b5/src/vs/base/common/uri.ts", "https://github.com/lalalune/agent-deeplinks/actions/runs/45454069271/job/138658637744"];
431
434
  readonly fields: {
432
435
  readonly prompt: "prompt";
433
436
  readonly session: "session";
434
437
  };
438
+ readonly encodeQueryValuesTwice: true;
435
439
  readonly note: "Requires the Claude Code extension for VS Code. The stock Ubuntu extension opened its sign-in screen from this link. A fresh tab can prefill a draft or resume a session, and an open session keeps its existing draft.";
436
440
  };
437
441
  };
@@ -777,8 +781,8 @@ declare const catalog: {
777
781
  readonly desktop: {
778
782
  readonly url: "t3code://new";
779
783
  readonly evidence: "verified";
780
- readonly sources: readonly ["https://github.com/pingdotgg/t3code/blob/v0.1.11/packages/shared/src/promptLinks.ts", "https://github.com/lalalune/agent-deeplinks/actions/runs/45440501819/job/138609961589", "https://github.com/lalalune/agent-deeplinks/actions/runs/45440877037/job/138611312447"];
781
- readonly note: "Exact unsent draft verified in T3 Code 0.1.11 on macOS, Ubuntu, and Windows. The Windows app registered t3code: on first launch.";
784
+ readonly sources: readonly ["https://github.com/pingdotgg/t3code/blob/v0.1.11/packages/shared/src/promptLinks.ts", "https://github.com/lalalune/agent-deeplinks/actions/runs/45440501819/job/138609961589", "https://github.com/lalalune/agent-deeplinks/actions/runs/45440877037/job/138611312447", "https://github.com/lalalune/agent-deeplinks/actions/runs/45483428887/artifacts/14962886811"];
785
+ readonly note: "Exact unsent draft verified in T3 Code 0.1.11 on macOS, Ubuntu, and Windows. Both cold and warm Windows Shell opens reached the draft.";
782
786
  readonly behavior: "draft";
783
787
  readonly fields: {
784
788
  readonly prompt: "prompt";
package/dist/catalog.js CHANGED
@@ -226,10 +226,11 @@ const catalog = {
226
226
  sources: [
227
227
  grokBotDocs,
228
228
  "https://docs.x.ai/grok-bot/get-started",
229
+ "https://github.com/lalalune/agent-deeplinks/actions/runs/45483518818/artifacts/14964275753",
229
230
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45461984963/job/138686754025",
230
231
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45461984963/job/138686754337",
231
232
  ],
232
- note: "Stock Ubuntu and Windows apps received the exact link and opened at sign-in. Drafts require a signed-in eligible account and use the primary Bot unless you supply a Bot ID.",
233
+ note: "LaunchServices started the signed Grok Bot 1.3.0 app on macOS. Stock Ubuntu and Windows apps received the exact link and opened at sign-in. Drafts require an eligible account and use the primary Bot unless you supply a Bot ID.",
233
234
  },
234
235
  ios: {
235
236
  ...grokBotRoute,
@@ -321,14 +322,14 @@ const catalog = {
321
322
  },
322
323
  desktop: {
323
324
  url: "https://agent.meta.ai/chat",
324
- behavior: "launch",
325
+ behavior: "handoff",
325
326
  evidence: "verified",
326
327
  sources: [
327
328
  "https://agent.meta.ai/.well-known/apple-app-site-association",
328
- "https://github.com/lalalune/agent-deeplinks/actions/runs/45450575543/job/138646218114",
329
329
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45480862958/job/138753307658",
330
+ "https://github.com/lalalune/agent-deeplinks/actions/runs/45483440516/artifacts/14962696263",
330
331
  ],
331
- note: "On macOS, this Universal Link selected Muse 13.1 after the app's first launch and domain approval. Fresh installations can open Safari while macOS verifies the domain.",
332
+ note: "Ordinary macOS URL opening selected Muse 13.1 after its first launch and domain approval. A click in stock Chrome 157 reached the Muse website and its sign-in page.",
332
333
  },
333
334
  ios: {
334
335
  url: "https://applink.muse.ai/",
@@ -403,9 +404,9 @@ const catalog = {
403
404
  url: "claude://code/new",
404
405
  behavior: "draft",
405
406
  evidence: "verified",
406
- sources: claudeDesktopChecks,
407
- fields: { prompt: "q", folder: "folder" },
408
- 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. Signed-in composers on those platforms still need verification.",
407
+ sources: [...claudeDesktopChecks, "https://code.claude.com/docs/en/desktop#open-an-ssh-session-from-a-link"],
408
+ fields: { prompt: "q", folder: "folder", sshHost: "ssh_host", sshPort: "ssh_port", sshFolder: "ssh_folder" },
409
+ 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.",
409
410
  },
410
411
  ios: claudeCodeMobileRoute,
411
412
  android: claudeCodeMobileRoute,
@@ -423,8 +424,14 @@ const catalog = {
423
424
  launchUrl: "vscode://anthropic.claude-code/open",
424
425
  behavior: "draft",
425
426
  evidence: "documented",
426
- sources: [claudeVsCodeDocs, claudeCodeDocs, "https://github.com/lalalune/agent-deeplinks/actions/runs/45454069271/job/138658637744"],
427
+ sources: [
428
+ claudeVsCodeDocs,
429
+ "https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code",
430
+ "https://github.com/microsoft/vscode/blob/8a14f0cc1b08d531eb83255ea3764ae22aa932b5/src/vs/base/common/uri.ts",
431
+ "https://github.com/lalalune/agent-deeplinks/actions/runs/45454069271/job/138658637744",
432
+ ],
427
433
  fields: { prompt: "prompt", session: "session" },
434
+ encodeQueryValuesTwice: true,
428
435
  note: "Requires the Claude Code extension for VS Code. The stock Ubuntu extension opened its sign-in screen from this link. A fresh tab can prefill a draft or resume a session, and an open session keeps its existing draft.",
429
436
  },
430
437
  },
@@ -700,8 +707,9 @@ const catalog = {
700
707
  t3Source,
701
708
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45440501819/job/138609961589",
702
709
  "https://github.com/lalalune/agent-deeplinks/actions/runs/45440877037/job/138611312447",
710
+ "https://github.com/lalalune/agent-deeplinks/actions/runs/45483428887/artifacts/14962886811",
703
711
  ],
704
- note: "Exact unsent draft verified in T3 Code 0.1.11 on macOS, Ubuntu, and Windows. The Windows app registered t3code: on first launch.",
712
+ note: "Exact unsent draft verified in T3 Code 0.1.11 on macOS, Ubuntu, and Windows. Both cold and warm Windows Shell opens reached the draft.",
705
713
  },
706
714
  ios: {
707
715
  ...t3Route,
package/dist/index.js CHANGED
@@ -7,6 +7,9 @@ const hiddenPathCharacters = /[\p{Cc}\p{Cf}]/u;
7
7
  const qualifiedSkill = /^[\w.@-]+(?:\/[\w.@-]+)+$/u;
8
8
  const invalidSessionId = /[\\/\u0000]|\.\./u;
9
9
  const openCodePairingUrl = /^([A-Za-z]+:\/\/[^/@\\?#]+)\/auth\/connect\/([A-Za-z0-9_-]+)$/u;
10
+ const sshHostPattern = /^(?:[A-Za-z0-9._][A-Za-z0-9._-]{0,63}@)?([A-Za-z0-9.:_][A-Za-z0-9.:_-]{0,252})$/u;
11
+ const sshFolderCharacters = /^[\p{L}\p{N}\p{M}\p{P} +<=>^`|~$]+$/u;
12
+ const excludedSshFolderCharacters = /[\\'\u2018-\u201b\p{Default_Ignorable_Code_Point}\u0590-\u08ff\ufb1d-\ufdff\ufe70-\ufeff\u{10800}-\u{10fff}\u{1e800}-\u{1efff}\u{13441}\u{13442}\u{16910}\u{16fe4}]/u;
10
13
  function parseServerUrl(value) {
11
14
  try {
12
15
  const url = new URL(value);
@@ -32,6 +35,31 @@ function isLocalPath(path) {
32
35
  !hiddenPathCharacters.test(path) &&
33
36
  !path.split(/[\\/]/u).includes("..");
34
37
  }
38
+ function isSshFolder(folder) {
39
+ const withoutMarks = folder.replace(/\p{M}+/gu, "");
40
+ return /^(?:\/(?!\/)|~(?:\/|$))/u.test(folder) &&
41
+ folder.length <= 1024 && withoutMarks === withoutMarks.trim() &&
42
+ !/^\/\.(?:vol|file)(?:\/|$)/iu.test(folder) &&
43
+ sshFolderCharacters.test(folder) && !excludedSshFolderCharacters.test(folder) &&
44
+ !folder.split("/").includes("..") && !/\p{M}{4,}/u.test(folder) && !/ {3}/u.test(withoutMarks) &&
45
+ (folder.match(/ /gu)?.length ?? 0) <= 8;
46
+ }
47
+ function isSshTarget(host, port, folder) {
48
+ const hostname = sshHostPattern.exec(host)?.[1];
49
+ if (!hostname || hiddenPathCharacters.test(host))
50
+ return false;
51
+ // Match Claude Desktop’s check for host values that resemble JSON scalars.
52
+ try {
53
+ if (String(JSON.parse(host)) !== host)
54
+ return false;
55
+ }
56
+ catch {
57
+ // Ordinary hostnames are not JSON values.
58
+ }
59
+ if (port && (!/^[1-9]\d{0,4}$/u.test(port) || Number(port) > 65535 || /^[^:]+:\d+$/u.test(hostname)))
60
+ return false;
61
+ return !folder || isSshFolder(folder);
62
+ }
35
63
  function parseWorkspaceUri(value) {
36
64
  if (value !== value.trim() || hiddenPathCharacters.test(value) ||
37
65
  !/^(?:file:\/|vscode-remote:\/\/)/iu.test(value))
@@ -76,6 +104,9 @@ export function getAgentLink(agent, platform, options = {}) {
76
104
  if ([fields.cwd, fields.path, fields.directory, fields.folder].some((path) => path !== undefined && !isLocalPath(path))) {
77
105
  return null;
78
106
  }
107
+ if ((fields.sshHost || fields.sshPort || fields.sshFolder) &&
108
+ (fields.folder || !isSshTarget(fields.sshHost ?? "", fields.sshPort, fields.sshFolder)))
109
+ return null;
79
110
  if (fields.model && !fields.provider)
80
111
  return null;
81
112
  if (fields.mode && !route.modes?.includes(fields.mode))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-deeplinks",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "Evidence-backed deep links for AI agents with SVG icons and React helpers.",
5
5
  "type": "module",
6
6
  "license": "MIT",