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.
- package/dist/{SUPPORTED_CLIS-Bzr_YYLu.js → SUPPORTED_CLIS-CjxNjwW2.js} +2 -2
- package/dist/{SUPPORTED_CLIS-NP2basqU.js → SUPPORTED_CLIS-Qf38O9x0.js} +3 -3
- package/dist/{agent-yes.config-0G11aPWe.js → agent-yes.config-BhjzWavn.js} +2 -2
- package/dist/{agentShare-BgzKKAFp.js → agentShare-BiBjjRvI.js} +7 -7
- package/dist/{callback-CPEbx_V0.js → callback-B8k8Em2Q.js} +5 -5
- package/dist/callback-CpksJ29q.js +12 -0
- package/dist/{callbackCore-B3DNe_SP.js → callbackCore-CcbVa8r2.js} +1 -1
- package/dist/{callbackCore-BlNdDILy.js → callbackCore-Me97qn68.js} +1 -1
- package/dist/channels-CUOl2wrG.js +74 -0
- package/dist/channels-mAf4ztTJ.js +522 -0
- package/dist/channels.js +239 -0
- package/dist/cli.js +9 -9
- package/dist/{configShared-YKfS6NMe.js → configShared-BXz2vi4Q.js} +1 -1
- package/dist/{cwdConflictWarn-CKUsQ5_o.js → cwdConflictWarn-ArYYtOGy.js} +1 -1
- package/dist/{e2e-DB7BDdEA.js → e2e-CYlKpfxa.js} +2 -2
- package/dist/{expose-GWRXTGpj.js → expose-IjObc0ox.js} +1 -1
- package/dist/{forkNested-BWdv2mXC.js → forkNested-D11UZMk8.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{nodeRuntime-CgXWHe9p.js → nodeRuntime-BF_kAOwO.js} +1 -1
- package/dist/{notifyDaemon-D7rYBD3I.js → notifyDaemon-CPgtoBZx.js} +6 -6
- package/dist/{openBrowser-CSfI8zCG.js → openBrowser-BkfVWvPx.js} +1 -1
- package/dist/peer-BM805vTt.js +4 -0
- package/dist/peer-Cdzjr8Jd.js +366 -0
- package/dist/{remotes-ZqD0FHl_.js → remotes-BM3Zm8Wh.js} +3 -3
- package/dist/{remotes-BCgowsiu.js → remotes-CgXeqjac.js} +3 -3
- package/dist/{rustBinary-DhHjlhHV.js → rustBinary-Cjfm32uR.js} +2 -2
- package/dist/{schedule-BOhtrVIR.js → schedule-BnA6nSxV.js} +6 -6
- package/dist/{serve-TPasyukD.js → serve-BA9hUOmC.js} +28 -28
- package/dist/{setup-DE8lMboL.js → setup-V3zEZmVy.js} +3 -3
- package/dist/share-CDER9qNq.js +4 -0
- package/dist/{share-CrvxZO7o.js → share-D4K0JnHg.js} +3 -3
- package/dist/{spawnGate-CMlGqVN4.js → spawnGate-CRMR19Ql.js} +2 -2
- package/dist/{spawnGate-5jC6eiqk.js → spawnGate-DQRr_Gsy.js} +1 -1
- package/dist/store-Ba3SsoOx.js +211 -0
- package/dist/{subcommands-B-2o8r2B.js → subcommands-BT6D9lDx.js} +5 -5
- package/dist/{subcommands-BPFUbAqp.js → subcommands-DAAwPV_d.js} +25 -18
- package/dist/{todoCli-Cjhx3DqQ.js → todoCli-C6o6EP1r.js} +1 -1
- package/dist/{tray-C8VfnS7s.js → tray-DaNqCsZM.js} +1 -1
- package/dist/{ts-Cl1DluDM.js → ts-Dg3tUcQc.js} +5 -5
- package/dist/{versionChecker-qZA8b3cE.js → versionChecker-CrWyXkXs.js} +2 -2
- package/dist/{webrtcLink-CjckgIZe.js → webrtcLink-CEYNs0pt.js} +2 -2
- package/dist/{webrtcRemote-BMzEt9Cp.js → webrtcRemote-BhJlxnpJ.js} +3 -3
- package/dist/{workspaceConfig-De5tgjeO.js → workspaceConfig-DWLYPDdx.js} +1 -1
- package/dist/{ws-DVnuBJ1A.js → ws-DuOKn7Gw.js} +7 -7
- package/package.json +11 -3
- package/ts/channels/browser.ts +272 -0
- package/ts/channels/hlc.ts +67 -0
- package/ts/channels/index.ts +10 -0
- package/ts/channels/link.ts +89 -0
- package/ts/channels/op.ts +89 -0
- package/ts/channels/peer.ts +468 -0
- package/ts/channels/store.browser.ts +42 -0
- package/ts/channels/store.node.ts +72 -0
- package/ts/channels/store.ts +170 -0
- package/ts/channels.spec.ts +153 -0
- package/ts/channels.ts +623 -0
- package/ts/share.ts +6 -2
- package/ts/subcommands.ts +8 -0
- package/dist/callback-du5QneP1.js +0 -12
- package/dist/share-ieE7D0C1.js +0 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
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-
|
|
8
|
+
//# sourceMappingURL=SUPPORTED_CLIS-CjxNjwW2.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-Dg3tUcQc.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
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-
|
|
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-
|
|
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-
|
|
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 "./
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./webrtcLink-
|
|
8
|
-
import "./remotes-
|
|
9
|
-
import {
|
|
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-
|
|
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-
|
|
3
|
-
import { a as mintCapability, o as parseExpires } from "./callbackCore-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|