agent-yes 1.290.7 → 1.291.0

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.
Files changed (82) hide show
  1. package/dist/SUPPORTED_CLIS-BZP767UR.js +12 -0
  2. package/dist/{SUPPORTED_CLIS-hTRegnm5.js → SUPPORTED_CLIS-TiOdGi1h.js} +2 -2
  3. package/dist/{agentShare-C_LTEKEb.js → agentShare-D4N8StHO.js} +8 -8
  4. package/dist/{askCli-DR9vhdcV.js → askCli-DFsWcgpF.js} +3 -3
  5. package/dist/{browser-oqC3Ln2a.js → browser-wkzxw6lx.js} +3 -2
  6. package/dist/{callback-DAQ8wCtJ.js → callback-Bc2gnr_f.js} +3 -3
  7. package/dist/{callback-BEvLUUBR.js → callback-yCpK6Qpg.js} +7 -7
  8. package/dist/{channels-hOG3-R_3.js → channels-aYwLMbFV.js} +2 -2
  9. package/dist/cli.js +9 -9
  10. package/dist/{cmdPs-BAaLB4Pz.js → cmdPs-D5L3Eyh5.js} +7 -7
  11. package/dist/{cwdConflictWarn-BgXN56Jc.js → cwdConflictWarn-sQUONAye.js} +2 -2
  12. package/dist/{forkNested-CJ7lQQCe.js → forkNested-xtEeYpBQ.js} +3 -3
  13. package/dist/{globalPidIndex-DoaKEUkO.js → globalPidIndex-CRH9L9tn.js} +139 -12
  14. package/dist/globalPidIndex-DC93JhHQ.js +4 -0
  15. package/dist/index.js +5 -5
  16. package/dist/{messageLog-CVRSTLza.js → messageLog-Brx3w6zT.js} +2 -1
  17. package/dist/{notifyDaemon-Dnbe66Fl.js → notifyDaemon-CvUtRnAB.js} +7 -7
  18. package/dist/{parentLink-fdiuB13i.js → parentLink-BILJ32nA.js} +2 -2
  19. package/dist/{parentLink-bpDGuQi6.js → parentLink-CfbxykCv.js} +2 -2
  20. package/dist/{parentPingLoop-DWv-xJoi.js → parentPingLoop-CVOCiQp2.js} +4 -4
  21. package/dist/pidStore-Bpe8i_oU.js +6 -0
  22. package/dist/{pidStore-B73xnAeT.js → pidStore-DXWqzTSz.js} +2 -2
  23. package/dist/{remotes-DTXPW8U1.js → remotes-tmKwrr20.js} +3 -3
  24. package/dist/{remotes-C696AJzL.js → remotes-wPL0JtBs.js} +2 -2
  25. package/dist/{rustBinary-CZRPfa4y.js → rustBinary-C_EbyMTk.js} +2 -2
  26. package/dist/{rustBinary-jO6EN8LR.js → rustBinary-Clbk_K5c.js} +2 -2
  27. package/dist/{schedule-Hao0WqyJ.js → schedule-Ba_4wNVK.js} +7 -7
  28. package/dist/{serve-B2nisui8.js → serve-CJDQq_Jp.js} +46 -40
  29. package/dist/{setup-vCDTqyqR.js → setup-DwLAkbTC.js} +2 -2
  30. package/dist/share-Bmnd_qT0.js +4 -0
  31. package/dist/{share-DTlaFn6s.js → share-C9oGvjXT.js} +13 -4
  32. package/dist/spawnGate-BUEswFgo.js +5 -0
  33. package/dist/{spawnGate-B26UnzqP.js → spawnGate-YpHopveO.js} +2 -2
  34. package/dist/{subcommands-BpFdlCY0.js → subcommands-x8Pe7DrF.js} +6 -6
  35. package/dist/{subcommands-D6LBtVPM.js → subcommands-yWgVRM2r.js} +273 -45
  36. package/dist/{terminal-iGHEnc7Z.js → terminal-Dv73BTE-.js} +2 -2
  37. package/dist/terminal.js +1 -1
  38. package/dist/{todoCli-azqbjBtz.js → todoCli-DSQXAcwA.js} +3 -3
  39. package/dist/{todoIdentity-NEceTmEe.js → todoIdentity-CAmnkzzP.js} +2 -2
  40. package/dist/{trayApp-BdNlQCFx.js → trayApp-BRw8f0mT.js} +2 -2
  41. package/dist/trayApp-BjQ5V3WV.js +5 -0
  42. package/dist/{ts-oyuaLWWx.js → ts-C8PxhJZM.js} +7 -7
  43. package/dist/{versionChecker-CMjS88mL.js → versionChecker-CWPGASjD.js} +2 -2
  44. package/dist/webrtcLink-CnQf9pmu.js +73 -0
  45. package/dist/{webrtcRemote-L5NxhLLR.js → webrtcRemote-yvMYsij3.js} +2 -2
  46. package/dist/{widget-OvkqW2Z6.js → widget-DhBSNUey.js} +3 -3
  47. package/dist/widgets.js +1 -1
  48. package/dist/{ws-BeMouYAU.js → ws-CMX0pkti.js} +2 -2
  49. package/dist/{ws-qZy7Giub.js → ws-DZ9YAXlY.js} +7 -7
  50. package/lab/ui/console-logic.js +27 -4
  51. package/package.json +1 -1
  52. package/ts/crossTreeClaim.bun.spec.ts +76 -0
  53. package/ts/crossTreeClaim.spec.ts +76 -0
  54. package/ts/globalPidIndex.spec.ts +153 -0
  55. package/ts/globalPidIndex.ts +151 -10
  56. package/ts/messageLog.bun.spec.ts +33 -0
  57. package/ts/messageLog.spec.ts +33 -0
  58. package/ts/messageLog.ts +3 -0
  59. package/ts/rawInputDeclared.bun.spec.ts +68 -0
  60. package/ts/rawInputDeclared.spec.ts +68 -0
  61. package/ts/remoteHealth.bun.spec.ts +130 -0
  62. package/ts/remoteHealth.spec.ts +130 -0
  63. package/ts/remoteHealth.ts +149 -0
  64. package/ts/restartKillGuard.bun.spec.ts +40 -0
  65. package/ts/restartKillGuard.spec.ts +40 -0
  66. package/ts/senderAncestry.ts +45 -7
  67. package/ts/serve.ts +46 -20
  68. package/ts/share.bun.spec.ts +24 -2
  69. package/ts/share.spec.ts +24 -2
  70. package/ts/share.ts +37 -5
  71. package/ts/subcommands.ts +239 -19
  72. package/ts/terminal/browser.ts +5 -1
  73. package/ts/webrtcLink.bun.spec.ts +45 -1
  74. package/ts/webrtcLink.spec.ts +45 -1
  75. package/ts/webrtcLink.ts +63 -19
  76. package/dist/SUPPORTED_CLIS-CuvT3tKq.js +0 -12
  77. package/dist/globalPidIndex-yvWZXeWT.js +0 -4
  78. package/dist/pidStore-V51mbgZY.js +0 -6
  79. package/dist/share-BvU4I8BI.js +0 -4
  80. package/dist/spawnGate-C8MSRt7X.js +0 -5
  81. package/dist/trayApp-Br2T2Yrb.js +0 -5
  82. package/dist/webrtcLink-DLaJfTcB.js +0 -45
package/ts/webrtcLink.ts CHANGED
@@ -13,30 +13,74 @@ export interface WebrtcLink {
13
13
  host: string;
14
14
  }
15
15
 
16
+ /** room + RAW token (marker and all), before parseSecret strips the `e1.`. */
17
+ interface RawLink {
18
+ room: string;
19
+ token: string;
20
+ host: string;
21
+ }
22
+
23
+ // The fragment of a /room/ link is a key=value set, parsed with URLSearchParams:
24
+ //
25
+ // https://agent-yes.com/room/#room=<id>&s=e1.<64hex>[&sig=<host>]
26
+ //
27
+ // Positional (#<room>:<token>[@<sighost>]) is the older /w/ console form, kept
28
+ // working forever for saved links and PWA caches. New links use key=value
29
+ // because the fragment namespace is shared with #k=, #ch= and #launch=, and the
30
+ // positional grammar can only be told apart from those by a blocklist that has
31
+ // to be updated for every new key (see parseRoomHash in lab/ui/rtc.js). A leading
32
+ // "?" is tolerated (#?room=…) since that spelling is also in the wild.
33
+ //
34
+ // NOTE: URLSearchParams percent-decodes and reads "+" as a space. The secret is
35
+ // `e1.` + hex so it survives untouched, but any future value must be written
36
+ // with encodeURIComponent.
37
+ function parseFragment(frag: string): RawLink | null {
38
+ if (/^\??[A-Za-z_]+=/.test(frag)) {
39
+ const q = new URLSearchParams(frag.replace(/^\?/, ""));
40
+ const room = q.get("room");
41
+ const token = q.get("s");
42
+ if (!room || !token) return null;
43
+ return { room, token, host: q.get("sig") || DEFAULT_SIGHOST };
44
+ }
45
+ const at = frag.split("@");
46
+ const seg = at[0]!;
47
+ const i = seg.indexOf(":");
48
+ if (i < 0) return null;
49
+ return { room: seg.slice(0, i), token: seg.slice(i + 1), host: at[1] || DEFAULT_SIGHOST };
50
+ }
51
+
52
+ /** Parse a share link WITHOUT validating/stripping the secret's version marker. */
53
+ function parseRaw(link: string): RawLink | null {
54
+ const wr = /^webrtc:\/\/([^:]+):([^@]+)@(.+)$/.exec(link);
55
+ if (wr) return { room: wr[1]!, token: wr[2]!, host: wr[3]! };
56
+ if (/^https?:\/\//.test(link) && link.includes("#"))
57
+ return parseFragment(link.split("#")[1] ?? "");
58
+ return null;
59
+ }
60
+
16
61
  /**
17
62
  * Parse a share link into { room, secret, signaling-host }. Accepts:
18
- * webrtc://<room>:<token>@<host>
19
- * https://<anyhost>/w/#<room>:<token> (signaling host defaults to s.agent-yes.com)
20
- * https://<anyhost>/w/#<room>:<token>@<sighost> (explicit signaling host)
63
+ * webrtc://<room>:<token>@<host> (internal / legacy form)
64
+ * https://<anyhost>/room/#room=<id>&s=<token>[&sig=<host>]
65
+ * https://<anyhost>/w/#<room>:<token>[@<sighost>] (older positional form)
21
66
  * Returns null if the string isn't a recognizable share link.
22
67
  */
23
68
  export function parseWebrtcLink(link: string): WebrtcLink | null {
24
- const wr = /^webrtc:\/\/([^:]+):([^@]+)@(.+)$/.exec(link);
25
- if (wr) {
26
- const { s } = parseSecret(wr[2]!);
27
- return { room: wr[1]!, s, host: wr[3]! };
28
- }
29
- if (/^https?:\/\//.test(link) && link.includes("#")) {
30
- const frag = link.split("#")[1] ?? "";
31
- const at = frag.split("@");
32
- const host = at[1] || DEFAULT_SIGHOST;
33
- const seg = at[0]!;
34
- const i = seg.indexOf(":");
35
- if (i < 0) return null;
36
- const { s } = parseSecret(seg.slice(i + 1));
37
- return { room: seg.slice(0, i), s, host };
38
- }
39
- return null;
69
+ const raw = parseRaw(link);
70
+ if (!raw) return null;
71
+ const { s } = parseSecret(raw.token);
72
+ return { room: raw.room, s, host: raw.host };
73
+ }
74
+
75
+ /**
76
+ * Normalize any accepted share-link spelling to the internal
77
+ * `webrtc://<room>:<token>@<host>` form that startShare/parseShareUrl consume.
78
+ * Returns the RAW token, so a legacy markerless room round-trips unchanged
79
+ * instead of being handed a marker it never had.
80
+ */
81
+ export function toWebrtcUrl(link: string): string | null {
82
+ const raw = parseRaw(link);
83
+ return raw ? `webrtc://${raw.room}:${raw.token}@${raw.host}` : null;
40
84
  }
41
85
 
42
86
  /** True if `spec` looks like a WebRTC share link (vs. an http remote or alias). */
@@ -1,12 +0,0 @@
1
- import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-CMjS88mL.js";
3
- import "./ts-oyuaLWWx.js";
4
- import "./todoAutomation-CbVVS4re.js";
5
- import "./JsonlStore-BqF7AQ6E.js";
6
- import "./globalPidIndex-DoaKEUkO.js";
7
- import "./pidStore-B73xnAeT.js";
8
- import "./messageLog-CVRSTLza.js";
9
- import "./todoStore-DF6vxHgV.js";
10
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-hTRegnm5.js";
11
-
12
- export { SUPPORTED_CLIS };
@@ -1,4 +0,0 @@
1
- import "./logger-CDIsZ-Pp.js";
2
- import { a as updateGlobalPidStatus, i as readGlobalPids, n as maybeCompactGlobalPids, r as pruneOldLogs, t as appendGlobalPid } from "./globalPidIndex-DoaKEUkO.js";
3
-
4
- export { readGlobalPids };
@@ -1,6 +0,0 @@
1
- import "./logger-CDIsZ-Pp.js";
2
- import "./JsonlStore-BqF7AQ6E.js";
3
- import "./globalPidIndex-DoaKEUkO.js";
4
- import { t as PidStore } from "./pidStore-B73xnAeT.js";
5
-
6
- export { PidStore };
@@ -1,4 +0,0 @@
1
- import "./e2e-z1xpwSAg.js";
2
- import { a as startShare, i as shareLinkFromRoomUrl, n as importRTC, r as loadOrCreateShareRoom, t as getIceServers } from "./share-DTlaFn6s.js";
3
-
4
- export { getIceServers, importRTC, loadOrCreateShareRoom, shareLinkFromRoomUrl, startShare };
@@ -1,5 +0,0 @@
1
- import "./logger-CDIsZ-Pp.js";
2
- import "./globalPidIndex-DoaKEUkO.js";
3
- import { i as waitForSpawnCapacity, n as spawnGateEnabled, r as spawnRejectionReason, t as memAvailableMb } from "./spawnGate-B26UnzqP.js";
4
-
5
- export { waitForSpawnCapacity };
@@ -1,5 +0,0 @@
1
- import "./versionChecker-CMjS88mL.js";
2
- import "./rustBinary-jO6EN8LR.js";
3
- import { a as trayHiddenMarker, i as launchTray, n as hasDesktop, r as isTrayHidden, t as cmdTray } from "./trayApp-BdNlQCFx.js";
4
-
5
- export { cmdTray };
@@ -1,45 +0,0 @@
1
- import { u as parseSecret } from "./e2e-z1xpwSAg.js";
2
-
3
- //#region ts/webrtcLink.ts
4
- const SIGNAL_SUBPROTOCOL = "ay-signal-1";
5
- const DEFAULT_SIGHOST = "s.agent-yes.com";
6
- /**
7
- * Parse a share link into { room, secret, signaling-host }. Accepts:
8
- * webrtc://<room>:<token>@<host>
9
- * https://<anyhost>/w/#<room>:<token> (signaling host defaults to s.agent-yes.com)
10
- * https://<anyhost>/w/#<room>:<token>@<sighost> (explicit signaling host)
11
- * Returns null if the string isn't a recognizable share link.
12
- */
13
- function parseWebrtcLink(link) {
14
- const wr = /^webrtc:\/\/([^:]+):([^@]+)@(.+)$/.exec(link);
15
- if (wr) {
16
- const { s } = parseSecret(wr[2]);
17
- return {
18
- room: wr[1],
19
- s,
20
- host: wr[3]
21
- };
22
- }
23
- if (/^https?:\/\//.test(link) && link.includes("#")) {
24
- const at = (link.split("#")[1] ?? "").split("@");
25
- const host = at[1] || DEFAULT_SIGHOST;
26
- const seg = at[0];
27
- const i = seg.indexOf(":");
28
- if (i < 0) return null;
29
- const { s } = parseSecret(seg.slice(i + 1));
30
- return {
31
- room: seg.slice(0, i),
32
- s,
33
- host
34
- };
35
- }
36
- return null;
37
- }
38
- /** True if `spec` looks like a WebRTC share link (vs. an http remote or alias). */
39
- function isWebrtcSpec(spec) {
40
- return spec.startsWith("webrtc://") || /^https?:\/\//.test(spec) && spec.includes("#");
41
- }
42
-
43
- //#endregion
44
- export { isWebrtcSpec as n, parseWebrtcLink as r, SIGNAL_SUBPROTOCOL as t };
45
- //# sourceMappingURL=webrtcLink-DLaJfTcB.js.map