agent-yes 1.230.0 → 1.231.0-beta.560.1

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 (60) hide show
  1. package/dist/{SUPPORTED_CLIS-Bzr_YYLu.js → SUPPORTED_CLIS-CjxNjwW2.js} +2 -2
  2. package/dist/{SUPPORTED_CLIS-NP2basqU.js → SUPPORTED_CLIS-Qf38O9x0.js} +3 -3
  3. package/dist/{agent-yes.config-0G11aPWe.js → agent-yes.config-BhjzWavn.js} +2 -2
  4. package/dist/{agentShare-BgzKKAFp.js → agentShare-BiBjjRvI.js} +7 -7
  5. package/dist/{callback-CPEbx_V0.js → callback-B8k8Em2Q.js} +5 -5
  6. package/dist/callback-CpksJ29q.js +12 -0
  7. package/dist/{callbackCore-B3DNe_SP.js → callbackCore-CcbVa8r2.js} +1 -1
  8. package/dist/{callbackCore-BlNdDILy.js → callbackCore-Me97qn68.js} +1 -1
  9. package/dist/channels-CUOl2wrG.js +74 -0
  10. package/dist/channels-mAf4ztTJ.js +522 -0
  11. package/dist/channels.js +239 -0
  12. package/dist/cli.js +9 -9
  13. package/dist/{configShared-YKfS6NMe.js → configShared-BXz2vi4Q.js} +1 -1
  14. package/dist/{cwdConflictWarn-CKUsQ5_o.js → cwdConflictWarn-ArYYtOGy.js} +1 -1
  15. package/dist/{e2e-DB7BDdEA.js → e2e-CYlKpfxa.js} +2 -2
  16. package/dist/{expose-GWRXTGpj.js → expose-IjObc0ox.js} +1 -1
  17. package/dist/{forkNested-BWdv2mXC.js → forkNested-D11UZMk8.js} +1 -1
  18. package/dist/index.js +2 -2
  19. package/dist/{nodeRuntime-CgXWHe9p.js → nodeRuntime-BF_kAOwO.js} +1 -1
  20. package/dist/{notifyDaemon-D7rYBD3I.js → notifyDaemon-CPgtoBZx.js} +6 -6
  21. package/dist/{openBrowser-CSfI8zCG.js → openBrowser-BkfVWvPx.js} +1 -1
  22. package/dist/peer-BM805vTt.js +4 -0
  23. package/dist/peer-Cdzjr8Jd.js +366 -0
  24. package/dist/{remotes-ZqD0FHl_.js → remotes-BM3Zm8Wh.js} +3 -3
  25. package/dist/{remotes-BCgowsiu.js → remotes-CgXeqjac.js} +3 -3
  26. package/dist/{rustBinary-DhHjlhHV.js → rustBinary-Cjfm32uR.js} +2 -2
  27. package/dist/{schedule-BOhtrVIR.js → schedule-BnA6nSxV.js} +6 -6
  28. package/dist/{serve-TPasyukD.js → serve-BA9hUOmC.js} +28 -28
  29. package/dist/{setup-DE8lMboL.js → setup-V3zEZmVy.js} +3 -3
  30. package/dist/share-CDER9qNq.js +4 -0
  31. package/dist/{share-CrvxZO7o.js → share-D4K0JnHg.js} +3 -3
  32. package/dist/{spawnGate-CMlGqVN4.js → spawnGate-CRMR19Ql.js} +2 -2
  33. package/dist/{spawnGate-5jC6eiqk.js → spawnGate-DQRr_Gsy.js} +1 -1
  34. package/dist/store-Ba3SsoOx.js +211 -0
  35. package/dist/{subcommands-B-2o8r2B.js → subcommands-BT6D9lDx.js} +5 -5
  36. package/dist/{subcommands-BPFUbAqp.js → subcommands-DAAwPV_d.js} +25 -18
  37. package/dist/{todoCli-Cjhx3DqQ.js → todoCli-C6o6EP1r.js} +1 -1
  38. package/dist/{tray-C8VfnS7s.js → tray-DaNqCsZM.js} +1 -1
  39. package/dist/{ts-Cl1DluDM.js → ts-Dg3tUcQc.js} +5 -5
  40. package/dist/{versionChecker-qZA8b3cE.js → versionChecker-CrWyXkXs.js} +2 -2
  41. package/dist/{webrtcLink-CjckgIZe.js → webrtcLink-CEYNs0pt.js} +2 -2
  42. package/dist/{webrtcRemote-BMzEt9Cp.js → webrtcRemote-BhJlxnpJ.js} +3 -3
  43. package/dist/{workspaceConfig-De5tgjeO.js → workspaceConfig-DWLYPDdx.js} +1 -1
  44. package/dist/{ws-DVnuBJ1A.js → ws-DuOKn7Gw.js} +7 -7
  45. package/package.json +11 -3
  46. package/ts/channels/browser.ts +272 -0
  47. package/ts/channels/hlc.ts +67 -0
  48. package/ts/channels/index.ts +10 -0
  49. package/ts/channels/link.ts +89 -0
  50. package/ts/channels/op.ts +89 -0
  51. package/ts/channels/peer.ts +468 -0
  52. package/ts/channels/store.browser.ts +42 -0
  53. package/ts/channels/store.node.ts +72 -0
  54. package/ts/channels/store.ts +170 -0
  55. package/ts/channels.spec.ts +153 -0
  56. package/ts/channels.ts +623 -0
  57. package/ts/share.ts +6 -2
  58. package/ts/subcommands.ts +8 -0
  59. package/dist/callback-du5QneP1.js +0 -12
  60. package/dist/share-ieE7D0C1.js +0 -4
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-Cl1DluDM.js";
1
+ import { t as CLIS_CONFIG } from "./ts-Dg3tUcQc.js";
2
2
 
3
3
  //#region ts/SUPPORTED_CLIS.ts
4
4
  const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
5
5
 
6
6
  //#endregion
7
7
  export { SUPPORTED_CLIS as t };
8
- //# sourceMappingURL=SUPPORTED_CLIS-Bzr_YYLu.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-CjxNjwW2.js.map
@@ -1,11 +1,11 @@
1
- import "./ts-Cl1DluDM.js";
1
+ import "./ts-Dg3tUcQc.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-qZA8b3cE.js";
3
+ import "./versionChecker-CrWyXkXs.js";
4
4
  import "./todoAutomation-x6guaQXc.js";
5
5
  import "./JsonlStore-CWOA3aDH.js";
6
6
  import "./globalPidIndex-Ca4sTr1b.js";
7
7
  import "./pidStore-Hjba3K6Q.js";
8
8
  import "./messageLog-zVGWLX7w.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Bzr_YYLu.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CjxNjwW2.js";
10
10
 
11
11
  export { SUPPORTED_CLIS };
@@ -1,5 +1,5 @@
1
1
  import { n as logger } from "./logger-CDIsZ-Pp.js";
2
- import { n as normalizeAgentYesConfig, t as loadSharedCliDefaults } from "./configShared-YKfS6NMe.js";
2
+ import { n as normalizeAgentYesConfig, t as loadSharedCliDefaults } from "./configShared-BXz2vi4Q.js";
3
3
  import os from "node:os";
4
4
  import { access, mkdir, readFile, writeFile } from "node:fs/promises";
5
5
  import path from "node:path";
@@ -226,4 +226,4 @@ async function getDefaultConfig() {
226
226
 
227
227
  //#endregion
228
228
  export { agent_yes_config_default as default };
229
- //# sourceMappingURL=agent-yes.config-0G11aPWe.js.map
229
+ //# sourceMappingURL=agent-yes.config-BhjzWavn.js.map
@@ -1,12 +1,12 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-Ca4sTr1b.js";
3
3
  import "./messageLog-zVGWLX7w.js";
4
- import "./configShared-YKfS6NMe.js";
5
- import { N as resolveOne } from "./subcommands-BPFUbAqp.js";
6
- import "./e2e-DB7BDdEA.js";
7
- import "./webrtcLink-CjckgIZe.js";
8
- import "./remotes-ZqD0FHl_.js";
9
- import { r as startShare } from "./share-CrvxZO7o.js";
4
+ import "./e2e-CYlKpfxa.js";
5
+ import "./configShared-BXz2vi4Q.js";
6
+ import { N as resolveOne } from "./subcommands-DAAwPV_d.js";
7
+ import "./webrtcLink-CEYNs0pt.js";
8
+ import "./remotes-BM3Zm8Wh.js";
9
+ import { a as startShare } from "./share-D4K0JnHg.js";
10
10
 
11
11
  //#region ts/agentShare.ts
12
12
  const MAX_SHARES = 8;
@@ -229,4 +229,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
229
229
 
230
230
  //#endregion
231
231
  export { createScopedShare, listShares, revokeAllShares, revokeShare };
232
- //# sourceMappingURL=agentShare-BgzKKAFp.js.map
232
+ //# sourceMappingURL=agentShare-BiBjjRvI.js.map
@@ -1,6 +1,6 @@
1
1
  import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
2
- import { N as resolveOne } from "./subcommands-BPFUbAqp.js";
3
- import { a as mintCapability, o as parseExpires } from "./callbackCore-BlNdDILy.js";
2
+ import { N as resolveOne } from "./subcommands-DAAwPV_d.js";
3
+ import { a as mintCapability, o as parseExpires } from "./callbackCore-Me97qn68.js";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { mkdir, readFile, writeFile } from "node:fs/promises";
6
6
  import path from "node:path";
@@ -72,7 +72,7 @@ async function resolveBase(flag) {
72
72
  if (flag) return flag;
73
73
  if (process.env.AGENT_YES_CALLBACK_BASE) return process.env.AGENT_YES_CALLBACK_BASE;
74
74
  try {
75
- const { resolveLocalServeUrl } = await import("./serve-TPasyukD.js");
75
+ const { resolveLocalServeUrl } = await import("./serve-BA9hUOmC.js");
76
76
  const url = await resolveLocalServeUrl();
77
77
  if (url) return url;
78
78
  } catch {}
@@ -170,7 +170,7 @@ async function cmdCallback(rest) {
170
170
  createdAt: Date.now()
171
171
  };
172
172
  saveStore(all);
173
- const { buildSnippet } = await import("./callbackCore-B3DNe_SP.js");
173
+ const { buildSnippet } = await import("./callbackCore-CcbVa8r2.js");
174
174
  w(`callback ${id} → ${record.cli} #${record.pid} @ ${record.cwd}`);
175
175
  w(`expires: ${new Date(exp).toISOString()} (${expiresSpec})`);
176
176
  w(`endpoint: ${base.replace(/\/+$/, "")}/cb/${cap}`);
@@ -187,4 +187,4 @@ async function cmdCallback(rest) {
187
187
 
188
188
  //#endregion
189
189
  export { loadOrCreateCallbackSecret as i, isCallbackRevoked as n, loadCallbackSecretReadOnly as r, cmdCallback as t };
190
- //# sourceMappingURL=callback-CPEbx_V0.js.map
190
+ //# sourceMappingURL=callback-B8k8Em2Q.js.map
@@ -0,0 +1,12 @@
1
+ import "./logger-CDIsZ-Pp.js";
2
+ import "./globalPidIndex-Ca4sTr1b.js";
3
+ import "./messageLog-zVGWLX7w.js";
4
+ import "./e2e-CYlKpfxa.js";
5
+ import "./configShared-BXz2vi4Q.js";
6
+ import "./subcommands-DAAwPV_d.js";
7
+ import "./webrtcLink-CEYNs0pt.js";
8
+ import "./remotes-BM3Zm8Wh.js";
9
+ import "./callbackCore-Me97qn68.js";
10
+ import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-B8k8Em2Q.js";
11
+
12
+ export { cmdCallback };
@@ -1,3 +1,3 @@
1
- import { a as mintCapability, i as frameVisitorMessage, n as MAX_EXPIRES_MS, o as parseExpires, r as buildSnippet, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-BlNdDILy.js";
1
+ import { a as mintCapability, i as frameVisitorMessage, n as MAX_EXPIRES_MS, o as parseExpires, r as buildSnippet, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-Me97qn68.js";
2
2
 
3
3
  export { buildSnippet };
@@ -140,4 +140,4 @@ function buildSnippet(opts) {
140
140
 
141
141
  //#endregion
142
142
  export { mintCapability as a, frameVisitorMessage as i, MAX_EXPIRES_MS as n, parseExpires as o, buildSnippet as r, verifyCapability as s, MAX_CALLBACK_MSG_BYTES as t };
143
- //# sourceMappingURL=callbackCore-BlNdDILy.js.map
143
+ //# sourceMappingURL=callbackCore-Me97qn68.js.map
@@ -0,0 +1,74 @@
1
+ import { m as validateS, u as parseSecret } from "./e2e-CYlKpfxa.js";
2
+
3
+ //#region ts/channels/link.ts
4
+ const CH_DEFAULT_SIGHOST = "s.agent-yes.com";
5
+ const HEX64 = /^[0-9a-f]{64}$/;
6
+ const subtle = globalThis.crypto.subtle;
7
+ const enc = new TextEncoder();
8
+ async function sha256Hex(input) {
9
+ const digest = new Uint8Array(await subtle.digest("SHA-256", enc.encode(input)));
10
+ let s = "";
11
+ for (const b of digest) s += b.toString(16).padStart(2, "0");
12
+ return s;
13
+ }
14
+ /** Local replica id: `sha256("ay/ch/id\n" + S)[:16]`. Topic-blind. */
15
+ async function deriveChannelId(s) {
16
+ return (await sha256Hex(`ay/ch/id\n${validateS(s)}`)).slice(0, 16);
17
+ }
18
+ /** Signaling rendezvous name: `"c" + sha256("ay/ch/room\n" + S)[:12]`. */
19
+ async function deriveRoom(s) {
20
+ return "c" + (await sha256Hex(`ay/ch/room\n${validateS(s)}`)).slice(0, 12);
21
+ }
22
+ /** True if `str` looks like a channel invite link. */
23
+ function isChannelLink(str) {
24
+ return str.startsWith("ay://ch/") || /^https?:\/\//.test(str) && str.includes("#ch=");
25
+ }
26
+ /**
27
+ * Format a channel invite:
28
+ * ay://ch/<sighost>/<room>#e1.<64hex>
29
+ * The secret rides the fragment; on the https form it is never sent to a server.
30
+ */
31
+ function formatChannelLink(link) {
32
+ return `ay://ch/${link.sighost}/${link.room}#e1.${validateS(link.s)}`;
33
+ }
34
+ /** Browser-console form: https://<host>/w/#ch=<room>:e1.<64hex>[@<sighost>]. */
35
+ function formatChannelWebLink(link, webHost = "agent-yes.com") {
36
+ const at = link.sighost === CH_DEFAULT_SIGHOST ? "" : `@${link.sighost}`;
37
+ return `https://${webHost}/w/#ch=${link.room}:e1.${validateS(link.s)}${at}`;
38
+ }
39
+ /**
40
+ * Parse either invite form back into { sighost, room, s }. Returns null if the
41
+ * string isn't a recognizable channel link; throws (via parseSecret) if the
42
+ * secret slot is present but malformed — never silently downgrades.
43
+ */
44
+ function parseChannelLink(link) {
45
+ const ay = /^ay:\/\/ch\/([^/]+)\/([^#]+)#(.+)$/.exec(link);
46
+ if (ay) {
47
+ const { s } = parseSecret(ay[3]);
48
+ if (!HEX64.test(s)) throw new Error("malformed channel link");
49
+ return {
50
+ sighost: ay[1],
51
+ room: ay[2],
52
+ s
53
+ };
54
+ }
55
+ if (/^https?:\/\//.test(link) && link.includes("#ch=")) {
56
+ const at = (link.split("#ch=")[1] ?? "").split("@");
57
+ const sighost = at[1] || CH_DEFAULT_SIGHOST;
58
+ const seg = at[0];
59
+ const i = seg.indexOf(":");
60
+ if (i < 0) return null;
61
+ const { s } = parseSecret(seg.slice(i + 1));
62
+ if (!HEX64.test(s)) throw new Error("malformed channel link");
63
+ return {
64
+ sighost,
65
+ room: seg.slice(0, i),
66
+ s
67
+ };
68
+ }
69
+ return null;
70
+ }
71
+
72
+ //#endregion
73
+ export { formatChannelWebLink as a, formatChannelLink as i, deriveChannelId as n, isChannelLink as o, deriveRoom as r, parseChannelLink as s, CH_DEFAULT_SIGHOST as t };
74
+ //# sourceMappingURL=channels-CUOl2wrG.js.map