agent-yes 1.51.4 → 1.52.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.
package/dist/cli.js CHANGED
@@ -4505,7 +4505,7 @@ const Yargs = YargsFactory(esm_default);
4505
4505
  //#endregion
4506
4506
  //#region package.json
4507
4507
  var name = "agent-yes";
4508
- var version = "1.51.4";
4508
+ var version = "1.52.0";
4509
4509
 
4510
4510
  //#endregion
4511
4511
  //#region ts/parseCliArgs.ts
@@ -4580,21 +4580,33 @@ function parseCliArgs(argv) {
4580
4580
  type: "boolean",
4581
4581
  description: "Use the Rust implementation instead of TypeScript",
4582
4582
  default: false
4583
+ }).option("swarm", {
4584
+ type: "string",
4585
+ description: `Enable swarm mode for multi-agent P2P networking (requires --rust).
4586
+ Formats:
4587
+ --swarm my-project Topic name (LAN auto-discovery)
4588
+ --swarm ABC-123 Room code (6-char, easy to share)
4589
+ --swarm "ay://..." Swarm URL (for internet)
4590
+ --swarm "/ip4/..." Raw multiaddr (direct connect)`
4583
4591
  }).option("experimental-swarm", {
4584
4592
  type: "boolean",
4585
- description: "Enable experimental swarm mode for multi-agent P2P networking (requires --rust)",
4586
- default: false
4593
+ description: "Deprecated: use --swarm instead",
4594
+ default: false,
4595
+ hidden: true
4587
4596
  }).option("swarm-topic", {
4588
4597
  type: "string",
4589
- description: "Topic for swarm communication",
4590
- default: "agent-yes-swarm"
4598
+ description: "Deprecated: use --swarm <topic> instead",
4599
+ default: "agent-yes-swarm",
4600
+ hidden: true
4591
4601
  }).option("swarm-listen", {
4592
4602
  type: "string",
4593
- description: "Listen address for swarm (e.g., /ip4/0.0.0.0/tcp/4001)"
4603
+ description: "Deprecated: use ay:// URL with listen param",
4604
+ hidden: true
4594
4605
  }).option("swarm-bootstrap", {
4595
4606
  type: "array",
4596
- description: "Bootstrap peer addresses for swarm",
4597
- default: []
4607
+ description: "Deprecated: use --swarm ay://...?peer=... instead",
4608
+ default: [],
4609
+ hidden: true
4598
4610
  }).positional("cli", {
4599
4611
  describe: "The AI CLI to run, e.g., claude, codex, copilot, cursor, gemini",
4600
4612
  type: "string",
@@ -4665,6 +4677,7 @@ function parseCliArgs(argv) {
4665
4677
  showVersion: parsedArgv.version,
4666
4678
  autoYes: parsedArgv.auto !== "no",
4667
4679
  useRust: parsedArgv.rust,
4680
+ swarm: parsedArgv.swarm ?? (parsedArgv.experimentalSwarm ? parsedArgv.swarmTopic : void 0),
4668
4681
  experimentalSwarm: parsedArgv.experimentalSwarm,
4669
4682
  swarmTopic: parsedArgv.swarmTopic,
4670
4683
  swarmListen: parsedArgv.swarmListen,
@@ -4878,9 +4891,10 @@ if (config.useRust) {
4878
4891
  process.exit(1);
4879
4892
  }
4880
4893
  const rawRustArgs = process.argv.slice(2).filter((arg) => arg !== "--rust" && !arg.startsWith("--rust="));
4894
+ const hasSwarmArg = rawRustArgs.some((arg) => arg === "--swarm" || arg.startsWith("--swarm="));
4881
4895
  const cliFromScript = config.cli;
4882
4896
  const hasCliArg = rawRustArgs.some((arg) => arg.startsWith("--cli=") || arg === "--cli") || rawRustArgs.some((arg) => SUPPORTED_CLIS.includes(arg));
4883
- const rustArgs = cliFromScript && !hasCliArg ? [cliFromScript, ...rawRustArgs] : rawRustArgs;
4897
+ const rustArgs = cliFromScript && !hasCliArg && !hasSwarmArg ? [cliFromScript, ...rawRustArgs] : rawRustArgs;
4884
4898
  if (config.verbose) {
4885
4899
  console.log(`[rust] Using binary: ${rustBinary}`);
4886
4900
  console.log(`[rust] Args: ${rustArgs.join(" ")}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.51.4",
3
+ "version": "1.52.0",
4
4
  "description": "A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses.",
5
5
  "keywords": [
6
6
  "ai",
@@ -67,6 +67,7 @@
67
67
  },
68
68
  "scripts": {
69
69
  "build": "tsdown",
70
+ "build:rs": "cd rs && cargo build --release --features swarm",
70
71
  "postbuild": "bun ./ts/postbuild.ts",
71
72
  "demo": "bun run build && bun link && claude-yes -- demo",
72
73
  "dev": "bun ts/index.ts",
package/ts/cli.ts CHANGED
@@ -29,12 +29,16 @@ if (config.useRust) {
29
29
  // Build args for Rust binary (filter out --rust flag)
30
30
  const rawRustArgs = process.argv.slice(2).filter((arg) => arg !== "--rust" && !arg.startsWith("--rust="));
31
31
 
32
+ // Check if swarm mode is requested (don't prepend CLI name for swarm mode)
33
+ const hasSwarmArg = rawRustArgs.some(arg => arg === '--swarm' || arg.startsWith('--swarm='));
34
+
32
35
  // Prepend CLI name if detected from script name but not already in args
33
36
  // This ensures codex-yes --rust passes "codex" to the Rust binary
37
+ // Skip prepending for swarm mode since it doesn't spawn a CLI
34
38
  const cliFromScript = config.cli;
35
39
  const hasCliArg = rawRustArgs.some(arg => arg.startsWith('--cli=') || arg === '--cli') ||
36
40
  rawRustArgs.some(arg => SUPPORTED_CLIS.includes(arg));
37
- const rustArgs = cliFromScript && !hasCliArg
41
+ const rustArgs = cliFromScript && !hasCliArg && !hasSwarmArg
38
42
  ? [cliFromScript, ...rawRustArgs]
39
43
  : rawRustArgs;
40
44
 
@@ -120,24 +120,37 @@ export function parseCliArgs(argv: string[]) {
120
120
  description: "Use the Rust implementation instead of TypeScript",
121
121
  default: false,
122
122
  })
123
+ .option("swarm", {
124
+ type: "string",
125
+ description: `Enable swarm mode for multi-agent P2P networking (requires --rust).
126
+ Formats:
127
+ --swarm my-project Topic name (LAN auto-discovery)
128
+ --swarm ABC-123 Room code (6-char, easy to share)
129
+ --swarm "ay://..." Swarm URL (for internet)
130
+ --swarm "/ip4/..." Raw multiaddr (direct connect)`,
131
+ })
123
132
  .option("experimental-swarm", {
124
133
  type: "boolean",
125
- description: "Enable experimental swarm mode for multi-agent P2P networking (requires --rust)",
134
+ description: "Deprecated: use --swarm instead",
126
135
  default: false,
136
+ hidden: true,
127
137
  })
128
138
  .option("swarm-topic", {
129
139
  type: "string",
130
- description: "Topic for swarm communication",
140
+ description: "Deprecated: use --swarm <topic> instead",
131
141
  default: "agent-yes-swarm",
142
+ hidden: true,
132
143
  })
133
144
  .option("swarm-listen", {
134
145
  type: "string",
135
- description: "Listen address for swarm (e.g., /ip4/0.0.0.0/tcp/4001)",
146
+ description: "Deprecated: use ay:// URL with listen param",
147
+ hidden: true,
136
148
  })
137
149
  .option("swarm-bootstrap", {
138
150
  type: "array",
139
- description: "Bootstrap peer addresses for swarm",
151
+ description: "Deprecated: use --swarm ay://...?peer=... instead",
140
152
  default: [] as string[],
153
+ hidden: true,
141
154
  })
142
155
  .positional("cli", {
143
156
  describe: "The AI CLI to run, e.g., claude, codex, copilot, cursor, gemini",
@@ -250,6 +263,9 @@ export function parseCliArgs(argv: string[]) {
250
263
  showVersion: parsedArgv.version,
251
264
  autoYes: parsedArgv.auto !== "no", // auto-yes enabled by default, disabled with --auto=no
252
265
  useRust: parsedArgv.rust,
266
+ // New unified --swarm flag (takes precedence over deprecated flags)
267
+ swarm: parsedArgv.swarm ?? (parsedArgv.experimentalSwarm ? parsedArgv.swarmTopic : undefined),
268
+ // Deprecated flags (kept for backwards compatibility)
253
269
  experimentalSwarm: parsedArgv.experimentalSwarm,
254
270
  swarmTopic: parsedArgv.swarmTopic,
255
271
  swarmListen: parsedArgv.swarmListen,