agent-yes 1.131.0 → 1.132.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-QtoszbIC.js → SUPPORTED_CLIS-BPesg_4L.js} +2 -2
- package/dist/SUPPORTED_CLIS-DjJdQYz6.js +8 -0
- package/dist/{agent-yes.config-D6ycMApr.js → agent-yes.config-BKtCmmy9.js} +3 -3
- package/dist/{agentYesHome-BvaUOzCV.js → agentYesHome-_eJa3DaX.js} +1 -1
- package/dist/cli.js +12 -15
- package/dist/{configShared-C5QaNPnz.js → configShared-C1C04bbq.js} +1 -1
- package/dist/{globalPidIndex-C7r2m6s7.js → globalPidIndex-DlmmJlO8.js} +2 -2
- package/dist/index.js +5 -5
- package/dist/invokedCli-zdFbz1ST.js +25 -0
- package/dist/{logger-B9h0djqx.js → logger-CDIsZ-Pp.js} +1 -1
- package/dist/pidStore-DfHh3Yt0.js +5 -0
- package/dist/{pidStore-DWQoGxxA.js → pidStore-fqXqTKkh.js} +4 -4
- package/dist/{reaper-BLVA780B.js → reaper-BQgDb85W.js} +1 -1
- package/dist/{reaper-BkjPN7mw.js → reaper-C-eWAxIj.js} +2 -2
- package/dist/{remotes-BRCDVnR7.js → remotes-BdankQeI.js} +1 -1
- package/dist/{remotes-D8GvSbhf.js → remotes-PKKjfTI1.js} +1 -1
- package/dist/{runningLock-CJxsoGdb.js → runningLock-V4qvXgAw.js} +1 -1
- package/dist/{schedule-BGsUo_2s.js → schedule-aNvMTdRy.js} +8 -8
- package/dist/{serve-C9o_RRVC.js → serve-znyNiZVc.js} +13 -13
- package/dist/{setup-C1UKmIoW.js → setup-BqEV-ogv.js} +3 -3
- package/dist/{share-Cvb0PBKg.js → share-CoyAOa6e.js} +1 -1
- package/dist/{subcommands-BgZ46FBg.js → subcommands-DNT7eMot.js} +5 -5
- package/dist/{subcommands-DP2XsJNo.js → subcommands-M3r5XiOZ.js} +27 -17
- package/dist/{tray-BVnJLThD.js → tray-DsTv-C04.js} +2 -2
- package/dist/{ts-CFyen5cA.js → ts-D9W-U-KX.js} +9 -9
- package/dist/{versionChecker-DF1bftgQ.js → versionChecker-CVnISin2.js} +2 -2
- package/dist/{workspaceConfig-BJO4fzEn.js → workspaceConfig-BCOqRBEW.js} +2 -2
- package/lab/ui/blog/e2ee-share-links/index.html +3 -2
- package/lab/ui/blog/index.html +174 -0
- package/lab/ui/index.html +8 -3
- package/lab/ui/landing.html +3 -2
- package/package.json +1 -1
- package/ts/cli.ts +7 -2
- package/ts/invokedCli.spec.ts +30 -0
- package/ts/invokedCli.ts +32 -0
- package/ts/parseCliArgs.ts +4 -17
- package/ts/subcommands.spec.ts +36 -0
- package/ts/subcommands.ts +0 -0
- package/dist/SUPPORTED_CLIS-BeiCQyhf.js +0 -8
- package/dist/pidStore-BweOirbR.js +0 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-D9W-U-KX.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-BPesg_4L.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ts-D9W-U-KX.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-CVnISin2.js";
|
|
4
|
+
import "./pidStore-fqXqTKkh.js";
|
|
5
|
+
import "./globalPidIndex-DlmmJlO8.js";
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BPesg_4L.js";
|
|
7
|
+
|
|
8
|
+
export { SUPPORTED_CLIS };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as logger } from "./logger-
|
|
2
|
-
import { n as normalizeAgentYesConfig, t as loadSharedCliDefaults } from "./configShared-
|
|
1
|
+
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
2
|
+
import { n as normalizeAgentYesConfig, t as loadSharedCliDefaults } from "./configShared-C1C04bbq.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-BKtCmmy9.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { t as invokedCliName } from "./invokedCli-zdFbz1ST.js";
|
|
3
|
+
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
4
|
+
import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-CVnISin2.js";
|
|
4
5
|
import { argv } from "process";
|
|
5
6
|
import { execFileSync, spawn } from "child_process";
|
|
6
7
|
import ms from "ms";
|
|
@@ -16,12 +17,7 @@ import path from "path";
|
|
|
16
17
|
* This is a test helper that mirrors the parsing logic in cli.ts
|
|
17
18
|
*/
|
|
18
19
|
function parseCliArgs(argv, supportedClis) {
|
|
19
|
-
const
|
|
20
|
-
const CLI_ALIASES = { cy: "claude" };
|
|
21
|
-
const cliName = (() => {
|
|
22
|
-
const raw = scriptBaseName.replace(/^(cli|agent)(-yes)?$/, "").replace(/^ay$/, "").replace(/-yes$/, "") || void 0;
|
|
23
|
-
return raw && CLI_ALIASES[raw] || raw;
|
|
24
|
-
})();
|
|
20
|
+
const cliName = invokedCliName(argv);
|
|
25
21
|
const parsedArgv = yargs(hideBin(argv)).usage("Usage: $0 [cli] [agent-yes args] [agent-cli args] [--] [prompts...]").example("$0 claude --timeout=30s -- solve all todos in my codebase, commit one by one", "Run Claude with a 30 seconds idle timeout (will type /exit when timeout), everything after `--` will be treated as the prompt").example("$0 claude --stdpush", "Run Claude with external stdin input enabled via --append-prompt").option("robust", {
|
|
26
22
|
type: "boolean",
|
|
27
23
|
default: true,
|
|
@@ -481,13 +477,14 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
481
477
|
}
|
|
482
478
|
{
|
|
483
479
|
const rawArg = process.argv[2];
|
|
480
|
+
const managerCommands = !invokedCliName(process.argv);
|
|
484
481
|
const isHelpFlag = rawArg === "-h" || rawArg === "--help";
|
|
485
|
-
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-
|
|
482
|
+
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-DNT7eMot.js");
|
|
486
483
|
if (isHelpFlag && process.argv.length === 3) {
|
|
487
|
-
cmdHelp();
|
|
484
|
+
cmdHelp(managerCommands);
|
|
488
485
|
process.exit(0);
|
|
489
486
|
}
|
|
490
|
-
if (isSubcommand(rawArg)) {
|
|
487
|
+
if (isSubcommand(rawArg, managerCommands)) {
|
|
491
488
|
const code = await runSubcommand(process.argv);
|
|
492
489
|
process.exit(code ?? 0);
|
|
493
490
|
}
|
|
@@ -496,12 +493,12 @@ await checkAndAutoUpdate();
|
|
|
496
493
|
logger.info(versionString());
|
|
497
494
|
const config = parseCliArgs(process.argv);
|
|
498
495
|
if (config.tray) {
|
|
499
|
-
const { startTray } = await import("./tray-
|
|
496
|
+
const { startTray } = await import("./tray-DsTv-C04.js");
|
|
500
497
|
await startTray();
|
|
501
498
|
await new Promise(() => {});
|
|
502
499
|
}
|
|
503
500
|
{
|
|
504
|
-
const { ensureTray } = await import("./tray-
|
|
501
|
+
const { ensureTray } = await import("./tray-DsTv-C04.js");
|
|
505
502
|
ensureTray();
|
|
506
503
|
}
|
|
507
504
|
if (config.useRust) {
|
|
@@ -515,7 +512,7 @@ if (config.useRust) {
|
|
|
515
512
|
}
|
|
516
513
|
}
|
|
517
514
|
if (rustBinary) {
|
|
518
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
515
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-DjJdQYz6.js");
|
|
519
516
|
const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
|
|
520
517
|
if (config.verbose) {
|
|
521
518
|
console.log(`[rust] Using binary: ${rustBinary}`);
|
|
@@ -545,7 +542,7 @@ if (config.showVersion) {
|
|
|
545
542
|
process.exit(0);
|
|
546
543
|
}
|
|
547
544
|
if (config.appendPrompt) {
|
|
548
|
-
const { PidStore } = await import("./pidStore-
|
|
545
|
+
const { PidStore } = await import("./pidStore-DfHh3Yt0.js");
|
|
549
546
|
const ipcPath = await PidStore.findActiveFifo(process.cwd());
|
|
550
547
|
if (!ipcPath) {
|
|
551
548
|
console.error("No active agent with IPC found in current directory.");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as logger } from "./logger-
|
|
1
|
+
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
2
2
|
import { appendFile, mkdir, readFile, rename, unlink, writeFile } from "fs/promises";
|
|
3
3
|
import { homedir } from "os";
|
|
4
4
|
import path from "path";
|
|
@@ -188,4 +188,4 @@ async function pruneOldLogs(maxAgeMs = retentionMs()) {
|
|
|
188
188
|
|
|
189
189
|
//#endregion
|
|
190
190
|
export { updateGlobalPidStatus as a, readGlobalPids as i, maybeCompactGlobalPids as n, pruneOldLogs as r, appendGlobalPid as t };
|
|
191
|
-
//# sourceMappingURL=globalPidIndex-
|
|
191
|
+
//# sourceMappingURL=globalPidIndex-DlmmJlO8.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-
|
|
2
|
-
import "./logger-
|
|
3
|
-
import "./versionChecker-
|
|
4
|
-
import "./pidStore-
|
|
5
|
-
import "./globalPidIndex-
|
|
1
|
+
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-D9W-U-KX.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-CVnISin2.js";
|
|
4
|
+
import "./pidStore-fqXqTKkh.js";
|
|
5
|
+
import "./globalPidIndex-DlmmJlO8.js";
|
|
6
6
|
|
|
7
7
|
export { AgentContext, CLIS_CONFIG, config, agentYes as default, removeControlCharacters };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region ts/invokedCli.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolve which agent CLI a binary invocation implies, from the binary name in
|
|
4
|
+
* argv[1].
|
|
5
|
+
*
|
|
6
|
+
* Every published bin (cy, claude-yes, codex-yes, ay, agent-yes, …) is the SAME
|
|
7
|
+
* cli.ts entry; the binary's *name* is what selects the default agent. A
|
|
8
|
+
* cli-bound alias — `cy` (= claude-yes = "agent-yes claude"), `codex-yes`, … —
|
|
9
|
+
* resolves to that agent; the generic manager entry (`ay` / `agent-yes` / `cli`)
|
|
10
|
+
* resolves to `undefined`. Callers use that `undefined` to tell "the agent-yes
|
|
11
|
+
* manager" apart from "a cli-bound runner alias".
|
|
12
|
+
*/
|
|
13
|
+
const CLI_ALIASES = { cy: "claude" };
|
|
14
|
+
/**
|
|
15
|
+
* The agent CLI implied by argv[1] (cy / claude-yes → "claude", codex-yes →
|
|
16
|
+
* "codex", …), or `undefined` for the generic `ay` / `agent-yes` / `cli` entry.
|
|
17
|
+
*/
|
|
18
|
+
function invokedCliName(argv) {
|
|
19
|
+
const raw = (argv[1]?.split(/[/\\]/).at(-1)?.replace(/(\.[jt]s)?$/, "") || "").replace(/^(cli|agent)(-yes)?$/, "").replace(/^ay$/, "").replace(/-yes$/, "") || void 0;
|
|
20
|
+
return raw && CLI_ALIASES[raw] || raw;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { invokedCliName as t };
|
|
25
|
+
//# sourceMappingURL=invokedCli-zdFbz1ST.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as logger } from "./logger-
|
|
2
|
-
import { t as agentYesHome } from "./agentYesHome-
|
|
3
|
-
import { a as updateGlobalPidStatus, n as maybeCompactGlobalPids, r as pruneOldLogs, t as appendGlobalPid } from "./globalPidIndex-
|
|
1
|
+
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
2
|
+
import { t as agentYesHome } from "./agentYesHome-_eJa3DaX.js";
|
|
3
|
+
import { a as updateGlobalPidStatus, n as maybeCompactGlobalPids, r as pruneOldLogs, t as appendGlobalPid } from "./globalPidIndex-DlmmJlO8.js";
|
|
4
4
|
import { closeSync, existsSync, fsyncSync, openSync } from "fs";
|
|
5
5
|
import { appendFile, mkdir, readFile, rename, writeFile } from "fs/promises";
|
|
6
6
|
import path from "path";
|
|
@@ -367,4 +367,4 @@ pid-db/
|
|
|
367
367
|
|
|
368
368
|
//#endregion
|
|
369
369
|
export { PidStore as t };
|
|
370
|
-
//# sourceMappingURL=pidStore-
|
|
370
|
+
//# sourceMappingURL=pidStore-fqXqTKkh.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as agentYesHome } from "./agentYesHome-
|
|
1
|
+
import { t as agentYesHome } from "./agentYesHome-_eJa3DaX.js";
|
|
2
2
|
import { appendFile, mkdir, readFile, rename, writeFile } from "fs/promises";
|
|
3
3
|
import path from "path";
|
|
4
4
|
|
|
@@ -83,4 +83,4 @@ async function sweep() {
|
|
|
83
83
|
|
|
84
84
|
//#endregion
|
|
85
85
|
export { register as n, sweep as r, pgidForWrapper as t };
|
|
86
|
-
//# sourceMappingURL=reaper-
|
|
86
|
+
//# sourceMappingURL=reaper-C-eWAxIj.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as resolveRemoteSpec, i as readRemotes, n as deleteRemoteAlias, o as writeRemoteAlias, r as parseDirectRemoteSpec, t as cmdRemote } from "./remotes-
|
|
1
|
+
import { a as resolveRemoteSpec, i as readRemotes, n as deleteRemoteAlias, o as writeRemoteAlias, r as parseDirectRemoteSpec, t as cmdRemote } from "./remotes-PKKjfTI1.js";
|
|
2
2
|
|
|
3
3
|
export { cmdRemote };
|
|
@@ -147,4 +147,4 @@ async function cmdRemote(rest) {
|
|
|
147
147
|
|
|
148
148
|
//#endregion
|
|
149
149
|
export { resolveRemoteSpec as a, readRemotes as i, deleteRemoteAlias as n, writeRemoteAlias as o, parseDirectRemoteSpec as r, cmdRemote as t };
|
|
150
|
-
//# sourceMappingURL=remotes-
|
|
150
|
+
//# sourceMappingURL=remotes-PKKjfTI1.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./ts-
|
|
2
|
-
import "./logger-
|
|
3
|
-
import "./versionChecker-
|
|
4
|
-
import "./pidStore-
|
|
5
|
-
import "./globalPidIndex-
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
7
|
-
import { n as resolveSpawnCwd } from "./workspaceConfig-
|
|
1
|
+
import "./ts-D9W-U-KX.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-CVnISin2.js";
|
|
4
|
+
import "./pidStore-fqXqTKkh.js";
|
|
5
|
+
import "./globalPidIndex-DlmmJlO8.js";
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BPesg_4L.js";
|
|
7
|
+
import { n as resolveSpawnCwd } from "./workspaceConfig-BCOqRBEW.js";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
|
|
10
10
|
//#region ts/oxmgrService.ts
|
|
@@ -141,4 +141,4 @@ async function cmdSchedule(rest) {
|
|
|
141
141
|
|
|
142
142
|
//#endregion
|
|
143
143
|
export { cmdSchedule };
|
|
144
|
-
//# sourceMappingURL=schedule-
|
|
144
|
+
//# sourceMappingURL=schedule-aNvMTdRy.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./ts-
|
|
2
|
-
import "./logger-
|
|
3
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
4
|
-
import "./pidStore-
|
|
5
|
-
import { a as updateGlobalPidStatus } from "./globalPidIndex-
|
|
6
|
-
import { t as pgidForWrapper } from "./reaper-
|
|
7
|
-
import "./configShared-
|
|
8
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
9
|
-
import "./remotes-
|
|
10
|
-
import { d as listRecords, g as resolveOne, i as controlCodeFromName, m as renderRawLog, p as readNotes, s as extractTaskCounts, x as writeToIpc, y as snapshotStatus } from "./subcommands-
|
|
1
|
+
import "./ts-D9W-U-KX.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import { r as getInstalledPackage } from "./versionChecker-CVnISin2.js";
|
|
4
|
+
import "./pidStore-fqXqTKkh.js";
|
|
5
|
+
import { a as updateGlobalPidStatus } from "./globalPidIndex-DlmmJlO8.js";
|
|
6
|
+
import { t as pgidForWrapper } from "./reaper-C-eWAxIj.js";
|
|
7
|
+
import "./configShared-C1C04bbq.js";
|
|
8
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BPesg_4L.js";
|
|
9
|
+
import "./remotes-PKKjfTI1.js";
|
|
10
|
+
import { d as listRecords, g as resolveOne, i as controlCodeFromName, m as renderRawLog, p as readNotes, s as extractTaskCounts, x as writeToIpc, y as snapshotStatus } from "./subcommands-M3r5XiOZ.js";
|
|
11
11
|
import yargs from "yargs";
|
|
12
12
|
import { mkdir, open, readFile, stat, writeFile } from "fs/promises";
|
|
13
13
|
import { homedir, hostname, userInfo } from "os";
|
|
@@ -247,7 +247,7 @@ async function cmdServeDaemon(sub, args) {
|
|
|
247
247
|
let shareLink = null;
|
|
248
248
|
let shareLinkMinted = false;
|
|
249
249
|
if (webrtcDaemon) try {
|
|
250
|
-
const { loadOrCreateShareRoom, shareLinkFromRoomUrl } = await import("./share-
|
|
250
|
+
const { loadOrCreateShareRoom, shareLinkFromRoomUrl } = await import("./share-CoyAOa6e.js");
|
|
251
251
|
const explicit = explicitWebrtcUrl(effArgs);
|
|
252
252
|
shareLink = shareLinkFromRoomUrl(explicit ?? await loadOrCreateShareRoom());
|
|
253
253
|
shareLinkMinted = !explicit;
|
|
@@ -1087,7 +1087,7 @@ Options:
|
|
|
1087
1087
|
const webrtcVal = argv.webrtc ?? argv.share;
|
|
1088
1088
|
const explicitUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
|
|
1089
1089
|
try {
|
|
1090
|
-
const { startShare, loadOrCreateShareRoom } = await import("./share-
|
|
1090
|
+
const { startShare, loadOrCreateShareRoom } = await import("./share-CoyAOa6e.js");
|
|
1091
1091
|
const linkFile = path.join(process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes"), ".share-link");
|
|
1092
1092
|
const announce = async (room, link, rotated) => {
|
|
1093
1093
|
const lead = rotated ? "the room was rejected by signaling (stale generation) — rotated to a fresh link" : "shared over WebRTC — open this link (the token is eaten from the URL on open)";
|
|
@@ -1142,4 +1142,4 @@ Options:
|
|
|
1142
1142
|
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
export { cmdServe };
|
|
1145
|
-
//# sourceMappingURL=serve-
|
|
1145
|
+
//# sourceMappingURL=serve-znyNiZVc.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as setWorkspaceRoot, t as getWorkspaceRoot } from "./workspaceConfig-
|
|
1
|
+
import { r as setWorkspaceRoot, t as getWorkspaceRoot } from "./workspaceConfig-BCOqRBEW.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { stdin, stdout } from "node:process";
|
|
4
4
|
import { createInterface } from "node:readline/promises";
|
|
@@ -32,7 +32,7 @@ async function cmdSetup(rest) {
|
|
|
32
32
|
if (!existsSync(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
|
|
33
33
|
if (noShare) return 0;
|
|
34
34
|
process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
|
|
35
|
-
const { cmdServe } = await import("./serve-
|
|
35
|
+
const { cmdServe } = await import("./serve-znyNiZVc.js");
|
|
36
36
|
return cmdServe([
|
|
37
37
|
"install",
|
|
38
38
|
"--share",
|
|
@@ -42,4 +42,4 @@ async function cmdSetup(rest) {
|
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
44
|
export { cmdSetup };
|
|
45
|
-
//# sourceMappingURL=setup-
|
|
45
|
+
//# sourceMappingURL=setup-BqEV-ogv.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./logger-
|
|
2
|
-
import "./globalPidIndex-
|
|
3
|
-
import "./configShared-
|
|
4
|
-
import "./remotes-
|
|
5
|
-
import { _ as resolveReadWindow, a as cursorAbs, b as stopTipForCli, c as finalizedLines, d as listRecords, f as matchKeyword, g as resolveOne, h as renderRawLogLines, i as controlCodeFromName, l as isPidAlive, m as renderRawLog, n as READ_PAGE_DEFAULT, o as extractNeedsInput, p as readNotes, r as cmdHelp, s as extractTaskCounts, t as GRACEFUL_EXIT_COMMANDS, u as isSubcommand, v as runSubcommand, x as writeToIpc, y as snapshotStatus } from "./subcommands-
|
|
1
|
+
import "./logger-CDIsZ-Pp.js";
|
|
2
|
+
import "./globalPidIndex-DlmmJlO8.js";
|
|
3
|
+
import "./configShared-C1C04bbq.js";
|
|
4
|
+
import "./remotes-PKKjfTI1.js";
|
|
5
|
+
import { _ as resolveReadWindow, a as cursorAbs, b as stopTipForCli, c as finalizedLines, d as listRecords, f as matchKeyword, g as resolveOne, h as renderRawLogLines, i as controlCodeFromName, l as isPidAlive, m as renderRawLog, n as READ_PAGE_DEFAULT, o as extractNeedsInput, p as readNotes, r as cmdHelp, s as extractTaskCounts, t as GRACEFUL_EXIT_COMMANDS, u as isSubcommand, v as runSubcommand, x as writeToIpc, y as snapshotStatus } from "./subcommands-M3r5XiOZ.js";
|
|
6
6
|
|
|
7
7
|
export { cmdHelp, isSubcommand, runSubcommand };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as invokedCliName } from "./invokedCli-zdFbz1ST.js";
|
|
2
|
+
import { t as agentYesHome } from "./agentYesHome-_eJa3DaX.js";
|
|
3
|
+
import { a as updateGlobalPidStatus, i as readGlobalPids } from "./globalPidIndex-DlmmJlO8.js";
|
|
4
|
+
import { t as loadSharedCliDefaults } from "./configShared-C1C04bbq.js";
|
|
5
|
+
import { a as resolveRemoteSpec, i as readRemotes } from "./remotes-PKKjfTI1.js";
|
|
5
6
|
import ms from "ms";
|
|
6
7
|
import yargs from "yargs";
|
|
7
8
|
import { appendFile, mkdir, open, readFile, stat, writeFile } from "fs/promises";
|
|
@@ -489,15 +490,22 @@ const SUBCOMMANDS = new Set([
|
|
|
489
490
|
"restart",
|
|
490
491
|
"note",
|
|
491
492
|
"serve",
|
|
492
|
-
"setup",
|
|
493
493
|
"schedule",
|
|
494
494
|
"remote",
|
|
495
495
|
"reap",
|
|
496
496
|
"help"
|
|
497
497
|
]);
|
|
498
|
+
const MANAGER_SUBCOMMANDS = new Set(["setup"]);
|
|
498
499
|
const IDLE_THRESHOLD_MS = 60 * 1e3;
|
|
499
|
-
|
|
500
|
-
|
|
500
|
+
/**
|
|
501
|
+
* Whether `name` is a subcommand. `managerCommands` (default true, for the
|
|
502
|
+
* generic `ay`/`agent-yes` entry) additionally admits manager-only commands
|
|
503
|
+
* like `setup`; pass false for a cli-bound alias (cy/claude-yes/…) so those
|
|
504
|
+
* names fall through to running the agent instead.
|
|
505
|
+
*/
|
|
506
|
+
function isSubcommand(name, managerCommands = true) {
|
|
507
|
+
if (!name) return false;
|
|
508
|
+
return SUBCOMMANDS.has(name) || managerCommands && MANAGER_SUBCOMMANDS.has(name);
|
|
501
509
|
}
|
|
502
510
|
/**
|
|
503
511
|
* Top-level entry. Returns the desired process exit code, or null if argv
|
|
@@ -505,7 +513,8 @@ function isSubcommand(name) {
|
|
|
505
513
|
*/
|
|
506
514
|
async function runSubcommand(argv) {
|
|
507
515
|
const sub = argv[2];
|
|
508
|
-
|
|
516
|
+
const managerCommands = !invokedCliName(argv);
|
|
517
|
+
if (!isSubcommand(sub, managerCommands)) return null;
|
|
509
518
|
const rest = argv.slice(3);
|
|
510
519
|
try {
|
|
511
520
|
switch (sub) {
|
|
@@ -524,25 +533,25 @@ async function runSubcommand(argv) {
|
|
|
524
533
|
case "restart": return await cmdRestart(rest);
|
|
525
534
|
case "note": return await cmdNote(rest);
|
|
526
535
|
case "serve": {
|
|
527
|
-
const { cmdServe } = await import("./serve-
|
|
536
|
+
const { cmdServe } = await import("./serve-znyNiZVc.js");
|
|
528
537
|
return cmdServe(rest);
|
|
529
538
|
}
|
|
530
539
|
case "setup": {
|
|
531
|
-
const { cmdSetup } = await import("./setup-
|
|
540
|
+
const { cmdSetup } = await import("./setup-BqEV-ogv.js");
|
|
532
541
|
return cmdSetup(rest);
|
|
533
542
|
}
|
|
534
543
|
case "schedule": {
|
|
535
|
-
const { cmdSchedule } = await import("./schedule-
|
|
544
|
+
const { cmdSchedule } = await import("./schedule-aNvMTdRy.js");
|
|
536
545
|
return cmdSchedule(rest);
|
|
537
546
|
}
|
|
538
547
|
case "remote": {
|
|
539
|
-
const { cmdRemote } = await import("./remotes-
|
|
548
|
+
const { cmdRemote } = await import("./remotes-BdankQeI.js");
|
|
540
549
|
return cmdRemote(rest);
|
|
541
550
|
}
|
|
542
551
|
case "reap":
|
|
543
|
-
await (await import("./reaper-
|
|
552
|
+
await (await import("./reaper-BQgDb85W.js")).sweep();
|
|
544
553
|
return 0;
|
|
545
|
-
case "help": return cmdHelp();
|
|
554
|
+
case "help": return cmdHelp(managerCommands);
|
|
546
555
|
default: return null;
|
|
547
556
|
}
|
|
548
557
|
} catch (err) {
|
|
@@ -551,8 +560,9 @@ async function runSubcommand(argv) {
|
|
|
551
560
|
return 1;
|
|
552
561
|
}
|
|
553
562
|
}
|
|
554
|
-
function cmdHelp() {
|
|
555
|
-
|
|
563
|
+
function cmdHelp(managerCommands = true) {
|
|
564
|
+
const setupLine = managerCommands ? ` ay setup guided setup: pick a workspace, share to agent-yes.com\n` : ``;
|
|
565
|
+
process.stdout.write("ay - agent-yes CLI\n\nManagement:\n ay ls [keyword] list running agents\n ay tail [-f] [-n N] <keyword> last N lines (96), -f to follow\n ay read <keyword> [page opts] paginate: --last/--head N, --range A:B,\n --before-line L [--limit N]\n ay cat <keyword> full log\n ay head <keyword> first N lines\n ay send <keyword> <msg> send a message\n ay attach <keyword> interactive attach (detach: Ctrl-\\)\n ay stop <keyword> graceful shutdown (/exit for claude/codex)\n ay status <keyword> agent status snapshot\n ay result <keyword> [--wait] pull an agent's structured result envelope\n ay result set '<json>' (inside an agent) deposit your result envelope\n ay reap kill process groups leaked by dead agents\n\nRemote:\n" + setupLine + " ay schedule <when> <cli> -- <msg> run an agent on a schedule (HH:MM or cron)\n ay serve [--port N] start HTTP API server (prints token)\n ay serve status show serve daemon/server status\n ay remote add <alias> http://<token>@<host>:<port>\n ay remote ls / rm <alias> manage saved remotes\n ay ls <token>@<host>:<port> connect inline (no alias needed)\n ay send <token>@<host>:<port>:<kw> <msg>\n\nRun an agent:\n ay [claude|codex|gemini|...] [options] -- [prompt]\n ay claude -- \"fix the bug in auth.ts\"\n ay claude --help full agent-runner options\n\nLabs (examples at https://github.com/snomiao/agent-yes/tree/main/lab):\n local-role-play/ designer + builder on one machine\n http-remote/ ay serve remote access demo\n p2p-pairing/ libp2p P2P (needs: cargo build --features swarm)\n");
|
|
556
566
|
return 0;
|
|
557
567
|
}
|
|
558
568
|
function matchKeyword(record, keyword) {
|
|
@@ -2408,4 +2418,4 @@ async function cmdResultSet(rest) {
|
|
|
2408
2418
|
|
|
2409
2419
|
//#endregion
|
|
2410
2420
|
export { resolveReadWindow as _, cursorAbs as a, stopTipForCli as b, finalizedLines as c, listRecords as d, matchKeyword as f, resolveOne as g, renderRawLogLines as h, controlCodeFromName as i, isPidAlive as l, renderRawLog as m, READ_PAGE_DEFAULT as n, extractNeedsInput as o, readNotes as p, cmdHelp as r, extractTaskCounts as s, GRACEFUL_EXIT_COMMANDS as t, isSubcommand as u, runSubcommand as v, writeToIpc as x, snapshotStatus as y };
|
|
2411
|
-
//# sourceMappingURL=subcommands-
|
|
2421
|
+
//# sourceMappingURL=subcommands-M3r5XiOZ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getRunningAgentCount } from "./runningLock-
|
|
1
|
+
import { n as getRunningAgentCount } from "./runningLock-V4qvXgAw.js";
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { mkdir, readFile, unlink, writeFile } from "fs/promises";
|
|
4
4
|
import { homedir } from "os";
|
|
@@ -187,4 +187,4 @@ async function startTray() {
|
|
|
187
187
|
|
|
188
188
|
//#endregion
|
|
189
189
|
export { ensureTray, startTray };
|
|
190
|
-
//# sourceMappingURL=tray-
|
|
190
|
+
//# sourceMappingURL=tray-DsTv-C04.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as logger, t as addTransport } from "./logger-
|
|
2
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
3
|
-
import { t as agentYesHome } from "./agentYesHome-
|
|
4
|
-
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-
|
|
5
|
-
import { t as PidStore } from "./pidStore-
|
|
6
|
-
import { i as readGlobalPids } from "./globalPidIndex-
|
|
7
|
-
import { n as register, r as sweep } from "./reaper-
|
|
1
|
+
import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
|
|
2
|
+
import { r as getInstalledPackage } from "./versionChecker-CVnISin2.js";
|
|
3
|
+
import { t as agentYesHome } from "./agentYesHome-_eJa3DaX.js";
|
|
4
|
+
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-V4qvXgAw.js";
|
|
5
|
+
import { t as PidStore } from "./pidStore-fqXqTKkh.js";
|
|
6
|
+
import { i as readGlobalPids } from "./globalPidIndex-DlmmJlO8.js";
|
|
7
|
+
import { n as register, r as sweep } from "./reaper-C-eWAxIj.js";
|
|
8
8
|
import { arch, platform } from "process";
|
|
9
9
|
import { execSync } from "child_process";
|
|
10
10
|
import { closeSync, constants, createReadStream, existsSync, mkdirSync, openSync } from "fs";
|
|
@@ -1060,7 +1060,7 @@ async function notifyWebhook(status, details, cwd = process.cwd()) {
|
|
|
1060
1060
|
|
|
1061
1061
|
//#endregion
|
|
1062
1062
|
//#region ts/index.ts
|
|
1063
|
-
const config = await import("./agent-yes.config-
|
|
1063
|
+
const config = await import("./agent-yes.config-BKtCmmy9.js").then((mod) => mod.default || mod);
|
|
1064
1064
|
const CLIS_CONFIG = config.clis;
|
|
1065
1065
|
/**
|
|
1066
1066
|
* Main function to run agent-cli with automatic yes/no responses
|
|
@@ -1787,4 +1787,4 @@ function sleep(ms) {
|
|
|
1787
1787
|
|
|
1788
1788
|
//#endregion
|
|
1789
1789
|
export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
|
|
1790
|
-
//# sourceMappingURL=ts-
|
|
1790
|
+
//# sourceMappingURL=ts-D9W-U-KX.js.map
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
|
|
|
7
7
|
|
|
8
8
|
//#region package.json
|
|
9
9
|
var name = "agent-yes";
|
|
10
|
-
var version = "1.
|
|
10
|
+
var version = "1.132.1";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ts/versionChecker.ts
|
|
@@ -215,4 +215,4 @@ async function displayVersion() {
|
|
|
215
215
|
|
|
216
216
|
//#endregion
|
|
217
217
|
export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
|
|
218
|
-
//# sourceMappingURL=versionChecker-
|
|
218
|
+
//# sourceMappingURL=versionChecker-CVnISin2.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as agentYesHome } from "./agentYesHome-
|
|
1
|
+
import { t as agentYesHome } from "./agentYesHome-_eJa3DaX.js";
|
|
2
2
|
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
3
3
|
import { homedir } from "os";
|
|
4
4
|
import path from "path";
|
|
@@ -53,4 +53,4 @@ function resolveSpawnCwd(input) {
|
|
|
53
53
|
|
|
54
54
|
//#endregion
|
|
55
55
|
export { resolveSpawnCwd as n, setWorkspaceRoot as r, getWorkspaceRoot as t };
|
|
56
|
-
//# sourceMappingURL=workspaceConfig-
|
|
56
|
+
//# sourceMappingURL=workspaceConfig-BCOqRBEW.js.map
|
|
@@ -291,8 +291,9 @@ e2e keys = HKDF(S, "ay/ay-e2e-1/key/…") → never leave your machine or bro
|
|
|
291
291
|
<footer>
|
|
292
292
|
Curious how it's built? The whole thing is about 200 lines:
|
|
293
293
|
<code>lab/ui/e2e.js</code> (the shared crypto), <code>ts/share.ts</code> (host), and the
|
|
294
|
-
console client in <code>lab/ui/index.html</code>.
|
|
295
|
-
<a href="
|
|
294
|
+
console client in <code>lab/ui/index.html</code>. <br /><br />
|
|
295
|
+
<a href="/blog/">← all posts</a> · <a href="/architecture.html">Architecture map</a> ·
|
|
296
|
+
<a href="/w/">Console</a> · <a href="/">agent-yes.com</a>
|
|
296
297
|
</footer>
|
|
297
298
|
</main>
|
|
298
299
|
</body>
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>agent-yes — blog & design notes</title>
|
|
7
|
+
<meta
|
|
8
|
+
name="description"
|
|
9
|
+
content="Design notes and write-ups for agent-yes: the architecture graph, end-to-end-encrypted share links, and more."
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
rel="icon"
|
|
13
|
+
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ctext y='14' font-size='14'%3E%E2%9C%93%3C/text%3E%3C/svg%3E"
|
|
14
|
+
/>
|
|
15
|
+
<style>
|
|
16
|
+
:root {
|
|
17
|
+
--bg: #0d1117;
|
|
18
|
+
--fg: #e6edf3;
|
|
19
|
+
--muted: #8b949e;
|
|
20
|
+
--accent: #58a6ff;
|
|
21
|
+
--green: #3fb950;
|
|
22
|
+
--card: #161b22;
|
|
23
|
+
--border: #30363d;
|
|
24
|
+
}
|
|
25
|
+
@media (prefers-color-scheme: light) {
|
|
26
|
+
:root {
|
|
27
|
+
--bg: #ffffff;
|
|
28
|
+
--fg: #1f2328;
|
|
29
|
+
--muted: #59636e;
|
|
30
|
+
--accent: #0969da;
|
|
31
|
+
--green: #1a7f37;
|
|
32
|
+
--card: #f6f8fa;
|
|
33
|
+
--border: #d0d7de;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
* {
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
body {
|
|
40
|
+
background: var(--bg);
|
|
41
|
+
color: var(--fg);
|
|
42
|
+
font:
|
|
43
|
+
16px/1.65 -apple-system,
|
|
44
|
+
BlinkMacSystemFont,
|
|
45
|
+
"Segoe UI",
|
|
46
|
+
Helvetica,
|
|
47
|
+
Arial,
|
|
48
|
+
sans-serif;
|
|
49
|
+
margin: 0;
|
|
50
|
+
padding: 0 20px;
|
|
51
|
+
}
|
|
52
|
+
main {
|
|
53
|
+
max-width: 760px;
|
|
54
|
+
margin: 0 auto;
|
|
55
|
+
padding: 40px 0 96px;
|
|
56
|
+
}
|
|
57
|
+
header {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
padding: 4px 0 28px;
|
|
62
|
+
}
|
|
63
|
+
.brand {
|
|
64
|
+
font-weight: 700;
|
|
65
|
+
font-size: 18px;
|
|
66
|
+
letter-spacing: -0.01em;
|
|
67
|
+
}
|
|
68
|
+
.brand .tick {
|
|
69
|
+
color: var(--green);
|
|
70
|
+
}
|
|
71
|
+
nav a {
|
|
72
|
+
color: var(--muted);
|
|
73
|
+
margin-left: 18px;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
}
|
|
76
|
+
a {
|
|
77
|
+
color: var(--accent);
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
}
|
|
80
|
+
a:hover {
|
|
81
|
+
text-decoration: underline;
|
|
82
|
+
}
|
|
83
|
+
h1 {
|
|
84
|
+
font-size: 2em;
|
|
85
|
+
line-height: 1.2;
|
|
86
|
+
margin: 12px 0 6px;
|
|
87
|
+
}
|
|
88
|
+
.sub {
|
|
89
|
+
color: var(--muted);
|
|
90
|
+
margin: 0 0 28px;
|
|
91
|
+
}
|
|
92
|
+
.post {
|
|
93
|
+
display: block;
|
|
94
|
+
background: var(--card);
|
|
95
|
+
border: 1px solid var(--border);
|
|
96
|
+
border-radius: 12px;
|
|
97
|
+
padding: 18px 20px;
|
|
98
|
+
margin: 14px 0;
|
|
99
|
+
color: inherit;
|
|
100
|
+
}
|
|
101
|
+
.post:hover {
|
|
102
|
+
text-decoration: none;
|
|
103
|
+
border-color: var(--accent);
|
|
104
|
+
}
|
|
105
|
+
.post .tag {
|
|
106
|
+
display: inline-block;
|
|
107
|
+
font-size: 0.72em;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
letter-spacing: 0.04em;
|
|
110
|
+
text-transform: uppercase;
|
|
111
|
+
color: var(--accent);
|
|
112
|
+
background: color-mix(in srgb, var(--accent) 14%, transparent);
|
|
113
|
+
border-radius: 999px;
|
|
114
|
+
padding: 2px 9px;
|
|
115
|
+
margin-bottom: 9px;
|
|
116
|
+
}
|
|
117
|
+
.post h2 {
|
|
118
|
+
font-size: 1.18em;
|
|
119
|
+
margin: 0 0 6px;
|
|
120
|
+
}
|
|
121
|
+
.post p {
|
|
122
|
+
margin: 0;
|
|
123
|
+
color: var(--muted);
|
|
124
|
+
font-size: 0.95em;
|
|
125
|
+
}
|
|
126
|
+
footer {
|
|
127
|
+
color: var(--muted);
|
|
128
|
+
font-size: 0.9em;
|
|
129
|
+
margin-top: 40px;
|
|
130
|
+
border-top: 1px solid var(--border);
|
|
131
|
+
padding-top: 20px;
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
134
|
+
</head>
|
|
135
|
+
<body>
|
|
136
|
+
<main>
|
|
137
|
+
<header>
|
|
138
|
+
<div class="brand"><span class="tick">✓</span> agent-yes</div>
|
|
139
|
+
<nav>
|
|
140
|
+
<a href="/">Home</a>
|
|
141
|
+
<a href="/w/">Console</a>
|
|
142
|
+
<a href="/architecture.html">Architecture</a>
|
|
143
|
+
<a href="https://github.com/snomiao/agent-yes">GitHub</a>
|
|
144
|
+
</nav>
|
|
145
|
+
</header>
|
|
146
|
+
|
|
147
|
+
<h1>Blog & design notes</h1>
|
|
148
|
+
<p class="sub">How agent-yes is built, and where it's going.</p>
|
|
149
|
+
|
|
150
|
+
<a class="post" href="/architecture.html">
|
|
151
|
+
<span class="tag">Architecture · living map</span>
|
|
152
|
+
<h2>The agent-yes graph — today & tomorrow</h2>
|
|
153
|
+
<p>
|
|
154
|
+
An interactive map of the whole system: one agent → one local fabric → one API handler →
|
|
155
|
+
many transports → one URL. What's built, what's experimental, and what's next.
|
|
156
|
+
</p>
|
|
157
|
+
</a>
|
|
158
|
+
|
|
159
|
+
<a class="post" href="/blog/e2ee-share-links/">
|
|
160
|
+
<span class="tag">Security</span>
|
|
161
|
+
<h2>End-to-end encryption for agent-yes share links</h2>
|
|
162
|
+
<p>
|
|
163
|
+
How share links stay private even if the signaling relay is compromised: an HKDF key
|
|
164
|
+
split, AES-256-GCM with per-connection keys, and a fail-closed handshake.
|
|
165
|
+
</p>
|
|
166
|
+
</a>
|
|
167
|
+
|
|
168
|
+
<footer>
|
|
169
|
+
<a href="/">← agent-yes.com</a> · <a href="/w/">Console</a> ·
|
|
170
|
+
<a href="https://github.com/snomiao/agent-yes">GitHub</a>
|
|
171
|
+
</footer>
|
|
172
|
+
</main>
|
|
173
|
+
</body>
|
|
174
|
+
</html>
|
package/lab/ui/index.html
CHANGED
|
@@ -2506,12 +2506,17 @@
|
|
|
2506
2506
|
|
|
2507
2507
|
// The local source is only worth polling when this page is actually backed
|
|
2508
2508
|
// by an ay serve: localhost, or served by `ay serve --http` (which leaves a
|
|
2509
|
-
// token), or when there are no rooms to fall back on.
|
|
2510
|
-
//
|
|
2509
|
+
// token), or when there are no rooms to fall back on. The public
|
|
2510
|
+
// agent-yes.com origin serves only static assets + WS rooms (no same-origin
|
|
2511
|
+
// /api), so never probe it — otherwise a bare /w/ visit (e.g. the landing's
|
|
2512
|
+
// "Console" link) 404s on /api/ls + /api/ls/subscribe every poll.
|
|
2511
2513
|
function ensureLocalSource() {
|
|
2512
2514
|
const isLocalhost = ["localhost", "127.0.0.1", "[::1]"].includes(location.hostname);
|
|
2513
2515
|
const hasToken = !!localStorage.getItem("ay.localToken");
|
|
2514
|
-
const
|
|
2516
|
+
const isPublicOrigin =
|
|
2517
|
+
location.hostname === "agent-yes.com" || location.hostname.endsWith(".agent-yes.com");
|
|
2518
|
+
const enabled =
|
|
2519
|
+
isLocalhost || hasToken || (!isPublicOrigin && Object.keys(loadRooms()).length === 0);
|
|
2515
2520
|
if (enabled && !sources.has(LOCAL)) {
|
|
2516
2521
|
const s = {
|
|
2517
2522
|
id: LOCAL,
|
package/lab/ui/landing.html
CHANGED
|
@@ -199,6 +199,7 @@
|
|
|
199
199
|
<div class="brand"><span class="tick">✓</span> agent-yes</div>
|
|
200
200
|
<nav>
|
|
201
201
|
<a href="/w/">Console</a>
|
|
202
|
+
<a href="/architecture.html">Architecture</a>
|
|
202
203
|
<a href="/blog/">Blog</a>
|
|
203
204
|
<a href="https://github.com/snomiao/agent-yes">GitHub</a>
|
|
204
205
|
</nav>
|
|
@@ -263,8 +264,8 @@ powershell -c "irm https://agent-yes.com/setup.ps1 | iex"</code></pre>
|
|
|
263
264
|
|
|
264
265
|
<footer class="wrap" style="padding-left: 0; padding-right: 0">
|
|
265
266
|
<div>
|
|
266
|
-
<a href="/w/">Console</a> · <a href="/
|
|
267
|
-
<a href="https://github.com/snomiao/agent-yes">GitHub</a> ·
|
|
267
|
+
<a href="/w/">Console</a> · <a href="/architecture.html">Architecture</a> ·
|
|
268
|
+
<a href="/blog/">Blog</a> · <a href="https://github.com/snomiao/agent-yes">GitHub</a> ·
|
|
268
269
|
<a href="https://www.npmjs.com/package/agent-yes">npm</a>
|
|
269
270
|
</div>
|
|
270
271
|
<div style="margin-top: 8px">
|
package/package.json
CHANGED
package/ts/cli.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { argv } from "process";
|
|
3
3
|
import { spawn } from "child_process";
|
|
4
4
|
import { parseCliArgs } from "./parseCliArgs.ts";
|
|
5
|
+
import { invokedCliName } from "./invokedCli.ts";
|
|
5
6
|
import { logger } from "./logger.ts";
|
|
6
7
|
import { checkAndAutoUpdate, displayVersion, versionString } from "./versionChecker.ts";
|
|
7
8
|
import { getRustBinary } from "./rustBinary.ts";
|
|
@@ -21,14 +22,18 @@ import { buildRustArgs } from "./buildRustArgs.ts";
|
|
|
21
22
|
// pid index instead. Must run before checkAndAutoUpdate / yargs / Rust spawn.
|
|
22
23
|
{
|
|
23
24
|
const rawArg = process.argv[2];
|
|
25
|
+
// Manager-only subcommands (e.g. `setup`) apply only to the generic
|
|
26
|
+
// `ay`/`agent-yes` entry, not to a cli-bound alias like `cy` (= claude-yes):
|
|
27
|
+
// `cy setup …` must run claude with that text, not manage the host.
|
|
28
|
+
const managerCommands = !invokedCliName(process.argv);
|
|
24
29
|
// Intercept bare -h/--help so we show TS subcommands, not just Rust agent-runner options.
|
|
25
30
|
const isHelpFlag = rawArg === "-h" || rawArg === "--help";
|
|
26
31
|
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands.ts");
|
|
27
32
|
if (isHelpFlag && process.argv.length === 3) {
|
|
28
|
-
cmdHelp();
|
|
33
|
+
cmdHelp(managerCommands);
|
|
29
34
|
process.exit(0);
|
|
30
35
|
}
|
|
31
|
-
if (isSubcommand(rawArg)) {
|
|
36
|
+
if (isSubcommand(rawArg, managerCommands)) {
|
|
32
37
|
const code = await runSubcommand(process.argv);
|
|
33
38
|
process.exit(code ?? 0);
|
|
34
39
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { invokedCliName } from "./invokedCli.ts";
|
|
3
|
+
|
|
4
|
+
// argv[1] is the invoked binary path; argv[0] is the runtime (node/bun).
|
|
5
|
+
const argv = (bin: string) => ["/usr/bin/bun", bin];
|
|
6
|
+
|
|
7
|
+
describe("invokedCliName", () => {
|
|
8
|
+
it("resolves cli-bound aliases to their agent", () => {
|
|
9
|
+
expect(invokedCliName(argv("/root/.bun/bin/cy"))).toBe("claude");
|
|
10
|
+
expect(invokedCliName(argv("/usr/local/bin/claude-yes"))).toBe("claude");
|
|
11
|
+
expect(invokedCliName(argv("/usr/local/bin/codex-yes"))).toBe("codex");
|
|
12
|
+
expect(invokedCliName(argv("gemini-yes"))).toBe("gemini");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("returns undefined for the generic manager entry", () => {
|
|
16
|
+
expect(invokedCliName(argv("/root/.bun/bin/ay"))).toBeUndefined();
|
|
17
|
+
expect(invokedCliName(argv("/usr/local/bin/agent-yes"))).toBeUndefined();
|
|
18
|
+
expect(invokedCliName(argv("/path/to/cli"))).toBeUndefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("ignores the .js / .ts extension the wrapper bins carry", () => {
|
|
22
|
+
expect(invokedCliName(argv("/app/dist/cy.js"))).toBe("claude");
|
|
23
|
+
expect(invokedCliName(argv("/app/dist/codex-yes.js"))).toBe("codex");
|
|
24
|
+
expect(invokedCliName(argv("/app/dist/agent-yes.js"))).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("is undefined when argv[1] is missing", () => {
|
|
28
|
+
expect(invokedCliName(["/usr/bin/bun"])).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
});
|
package/ts/invokedCli.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve which agent CLI a binary invocation implies, from the binary name in
|
|
3
|
+
* argv[1].
|
|
4
|
+
*
|
|
5
|
+
* Every published bin (cy, claude-yes, codex-yes, ay, agent-yes, …) is the SAME
|
|
6
|
+
* cli.ts entry; the binary's *name* is what selects the default agent. A
|
|
7
|
+
* cli-bound alias — `cy` (= claude-yes = "agent-yes claude"), `codex-yes`, … —
|
|
8
|
+
* resolves to that agent; the generic manager entry (`ay` / `agent-yes` / `cli`)
|
|
9
|
+
* resolves to `undefined`. Callers use that `undefined` to tell "the agent-yes
|
|
10
|
+
* manager" apart from "a cli-bound runner alias".
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Short aliases → target CLI. Must match the alias wrappers postbuild.ts emits.
|
|
14
|
+
export const CLI_ALIASES: Record<string, string> = { cy: "claude" };
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The agent CLI implied by argv[1] (cy / claude-yes → "claude", codex-yes →
|
|
18
|
+
* "codex", …), or `undefined` for the generic `ay` / `agent-yes` / `cli` entry.
|
|
19
|
+
*/
|
|
20
|
+
export function invokedCliName(argv: string[]): string | undefined {
|
|
21
|
+
const base =
|
|
22
|
+
argv[1]
|
|
23
|
+
?.split(/[/\\]/)
|
|
24
|
+
.at(-1)
|
|
25
|
+
?.replace(/(\.[jt]s)?$/, "") || "";
|
|
26
|
+
const raw =
|
|
27
|
+
base
|
|
28
|
+
.replace(/^(cli|agent)(-yes)?$/, "")
|
|
29
|
+
.replace(/^ay$/, "") // treat standalone "ay" same as "agent-yes"
|
|
30
|
+
.replace(/-yes$/, "") || undefined;
|
|
31
|
+
return (raw && CLI_ALIASES[raw]) || raw;
|
|
32
|
+
}
|
package/ts/parseCliArgs.ts
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
import ms from "ms";
|
|
2
2
|
import yargs from "yargs";
|
|
3
3
|
import { hideBin } from "yargs/helpers";
|
|
4
|
+
import { invokedCliName } from "./invokedCli.ts";
|
|
4
5
|
/**
|
|
5
6
|
* Parse CLI arguments the same way cli.ts does
|
|
6
7
|
* This is a test helper that mirrors the parsing logic in cli.ts
|
|
7
8
|
*/
|
|
8
9
|
export function parseCliArgs(argv: string[], supportedClis?: readonly string[]) {
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
?.split(/[/\\]/)
|
|
13
|
-
.at(-1)
|
|
14
|
-
?.replace(/(\.[jt]s)?$/, "") || "";
|
|
15
|
-
|
|
16
|
-
const CLI_ALIASES: Record<string, string> = { cy: "claude" };
|
|
17
|
-
|
|
18
|
-
const cliName = (() => {
|
|
19
|
-
const raw =
|
|
20
|
-
scriptBaseName
|
|
21
|
-
.replace(/^(cli|agent)(-yes)?$/, "")
|
|
22
|
-
.replace(/^ay$/, "") // treat standalone "ay" same as "agent-yes"
|
|
23
|
-
.replace(/-yes$/, "") || undefined;
|
|
24
|
-
return (raw && CLI_ALIASES[raw]) || raw;
|
|
25
|
-
})();
|
|
10
|
+
// The agent CLI implied by the invoked binary name (cy/claude-yes → claude),
|
|
11
|
+
// or undefined for the generic ay/agent-yes manager entry.
|
|
12
|
+
const cliName = invokedCliName(argv);
|
|
26
13
|
|
|
27
14
|
// Parse args with yargs (same logic as cli.ts:16-73)
|
|
28
15
|
const parsedArgv = yargs(hideBin(argv))
|
package/ts/subcommands.spec.ts
CHANGED
|
@@ -65,6 +65,42 @@ describe("subcommands.isSubcommand", () => {
|
|
|
65
65
|
expect(isSubcommand("not-a-command")).toBe(false);
|
|
66
66
|
expect(isSubcommand(undefined)).toBe(false);
|
|
67
67
|
});
|
|
68
|
+
|
|
69
|
+
it("gates manager-only `setup` on the generic manager, not cli-bound aliases", async () => {
|
|
70
|
+
const { isSubcommand } = await loadModule();
|
|
71
|
+
// `ay setup` (managerCommands defaults to true) → a subcommand.
|
|
72
|
+
expect(isSubcommand("setup")).toBe(true);
|
|
73
|
+
expect(isSubcommand("setup", true)).toBe(true);
|
|
74
|
+
// `cy setup` (cli-bound alias) → NOT a subcommand, so it falls through to
|
|
75
|
+
// running claude with that text.
|
|
76
|
+
expect(isSubcommand("setup", false)).toBe(false);
|
|
77
|
+
// Inspection subcommands stay universal — `cy ls` / `cy send` still work.
|
|
78
|
+
expect(isSubcommand("ls", false)).toBe(true);
|
|
79
|
+
expect(isSubcommand("send", false)).toBe(true);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe("subcommands.cmdHelp", () => {
|
|
84
|
+
it("hides the manager-only `setup` line for cli-bound aliases", async () => {
|
|
85
|
+
const { cmdHelp } = await loadModule();
|
|
86
|
+
const capture = (managerCommands?: boolean) => {
|
|
87
|
+
let out = "";
|
|
88
|
+
const spy = vi.spyOn(process.stdout, "write").mockImplementation((s: unknown) => {
|
|
89
|
+
out += String(s);
|
|
90
|
+
return true;
|
|
91
|
+
});
|
|
92
|
+
try {
|
|
93
|
+
cmdHelp(managerCommands);
|
|
94
|
+
} finally {
|
|
95
|
+
spy.mockRestore();
|
|
96
|
+
}
|
|
97
|
+
return out;
|
|
98
|
+
};
|
|
99
|
+
expect(capture(true)).toContain("ay setup"); // manager
|
|
100
|
+
expect(capture()).toContain("ay setup"); // default = manager
|
|
101
|
+
expect(capture(false)).not.toContain("ay setup"); // cli-bound alias (cy)
|
|
102
|
+
expect(capture(false)).toContain("ay ls"); // universal commands still shown
|
|
103
|
+
});
|
|
68
104
|
});
|
|
69
105
|
|
|
70
106
|
describe("subcommands.stopTipForCli", () => {
|
package/ts/subcommands.ts
CHANGED
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./ts-CFyen5cA.js";
|
|
2
|
-
import "./logger-B9h0djqx.js";
|
|
3
|
-
import "./versionChecker-DF1bftgQ.js";
|
|
4
|
-
import "./pidStore-DWQoGxxA.js";
|
|
5
|
-
import "./globalPidIndex-C7r2m6s7.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-QtoszbIC.js";
|
|
7
|
-
|
|
8
|
-
export { SUPPORTED_CLIS };
|