agentstuff 0.1.0 → 0.1.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 (3) hide show
  1. package/README.md +6 -6
  2. package/dist/index.js +29 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -11,26 +11,26 @@ bun add --global agentstuff
11
11
  agentstuff setup
12
12
  ```
13
13
 
14
- Setup installs the background service and terminal integration, adds the `ac` shortcut to your shell configuration, and displays a QR code. Scan the QR from the mobile app to connect the Mac directly.
14
+ Setup installs the background service and terminal integration, selects an available short command such as `agt`, and displays a QR code. Scan the QR from the mobile app to connect the Mac directly.
15
15
 
16
16
  Open a new terminal and start a live session:
17
17
 
18
18
  ```sh
19
19
  cd your-project
20
- ac
20
+ agt
21
21
  ```
22
22
 
23
23
  Arguments are forwarded unchanged:
24
24
 
25
25
  ```sh
26
- ac --resume
27
- ac --model opus
26
+ agt --resume
27
+ agt --model opus
28
28
  ```
29
29
 
30
30
  Use a different shortcut or leave your shell configuration untouched:
31
31
 
32
32
  ```sh
33
- agentstuff setup --alias agent
33
+ agentstuff setup --alias myagent
34
34
  agentstuff setup --no-alias
35
35
  ```
36
36
 
@@ -39,7 +39,7 @@ Without a shortcut, launch a connected session with `agentstuff claude`.
39
39
  ## Commands
40
40
 
41
41
  ```text
42
- agentstuff setup [--alias ac] [--no-alias] [--relay URL]
42
+ agentstuff setup [--alias NAME] [--no-alias] [--relay URL]
43
43
  agentstuff claude [arguments...]
44
44
  agentstuff pair [--reset] [--relay URL]
45
45
  agentstuff status
package/dist/index.js CHANGED
@@ -79332,6 +79332,7 @@ import { homedir as homedir3 } from "os";
79332
79332
  import { basename, dirname as dirname5, join as join5 } from "path";
79333
79333
  var blockStart = "# >>> agentstuff >>>";
79334
79334
  var blockEnd = "# <<< agentstuff <<<";
79335
+ var recommendedCommands = ["agt", "astuff"];
79335
79336
  var ShellCommandName = String4.pipe(check(makeFilter2((value2) => /^[A-Za-z_][A-Za-z0-9_-]*$/u.test(value2), { expected: "a safe shell command name" })));
79336
79337
 
79337
79338
  class ShellIntegrationError extends TaggedErrorClass()("ShellIntegrationError", {
@@ -79374,8 +79375,11 @@ var readExisting = fn2("ShellIntegration.readExisting")(function* (path5) {
79374
79375
  catch: (cause) => new ShellIntegrationError({ message: `Failed to read ${path5}`, cause })
79375
79376
  }).pipe(catch_2((error52) => isObject(error52.cause) && hasProperty(error52.cause, "code") && error52.cause.code === "ENOENT" ? succeed7("") : fail6(error52)));
79376
79377
  });
79377
- var managedCommand = (contents, commandName) => contents.includes(`${blockStart}
79378
- ${commandName}() {`);
79378
+ var managedCommandName = (contents) => {
79379
+ const block = contents.slice(contents.indexOf(blockStart), contents.indexOf(blockEnd));
79380
+ return /^# >>> agentstuff >>>\n([A-Za-z_][A-Za-z0-9_-]*)\(\) \{/u.exec(block)?.[1];
79381
+ };
79382
+ var selectShellCommand = (requested, occupied) => (requested === undefined ? recommendedCommands : [requested]).find((candidate) => !occupied.has(candidate));
79379
79383
  var commandExists = fn2("ShellIntegration.commandExists")(function* (shellPath, commandName) {
79380
79384
  if (Bun.which(commandName) !== null)
79381
79385
  return true;
@@ -79396,12 +79400,23 @@ var installShellIntegration = fn2("ShellIntegration.install")(function* (options
79396
79400
  cause: process.env.SHELL
79397
79401
  });
79398
79402
  }
79399
- const commandName = yield* decodeUnknownEffect2(ShellCommandName)(options?.commandName ?? "ac").pipe(mapError3((cause) => new ShellIntegrationError({ message: "Invalid shell shortcut", cause })));
79400
79403
  const existing = yield* readExisting(path5);
79401
- if (!managedCommand(existing, commandName) && (yield* commandExists(process.env.SHELL ?? "/bin/zsh", commandName))) {
79404
+ const requested = options?.commandName === undefined ? undefined : yield* decodeUnknownEffect2(ShellCommandName)(options.commandName).pipe(mapError3((cause) => new ShellIntegrationError({ message: "Invalid shell shortcut", cause })));
79405
+ const previous = requested === undefined ? managedCommandName(existing) : undefined;
79406
+ const preferred = requested ?? previous;
79407
+ const candidates = preferred === undefined ? recommendedCommands : [preferred];
79408
+ const occupied = new Set;
79409
+ for (const candidate of candidates) {
79410
+ if (candidate !== previous && (yield* commandExists(process.env.SHELL ?? "/bin/zsh", candidate))) {
79411
+ occupied.add(candidate);
79412
+ }
79413
+ }
79414
+ const commandName = selectShellCommand(preferred, occupied);
79415
+ if (commandName === undefined) {
79416
+ const display = requested === undefined ? recommendedCommands.join("`, `") : requested;
79402
79417
  return yield* new ShellIntegrationError({
79403
- message: `The shell command \`${commandName}\` already exists. Choose another with \`agentstuff setup --alias <name>\` or use \`--no-alias\`.`,
79404
- cause: commandName
79418
+ message: `The shell command${requested === undefined ? "s" : ""} \`${display}\` already exist${requested === undefined ? "" : "s"}. Choose another with \`agentstuff setup --alias <name>\` or use \`--no-alias\`.`,
79419
+ cause: display
79405
79420
  });
79406
79421
  }
79407
79422
  const next = mergeShellIntegration(existing, commandName);
@@ -82048,9 +82063,12 @@ var setup = fn2("Cli.setup")(function* (options) {
82048
82063
  yield* log("\u2713 Background service running");
82049
82064
  let launchCommand = "agentstuff claude";
82050
82065
  if (!options.noAlias) {
82051
- const shell = yield* installShellIntegration({ commandName: options.alias });
82052
- yield* log(`\u2713 ${shell.commandName} shortcut installed in ${shell.path}`);
82053
- launchCommand = shell.commandName;
82066
+ const requested = getOrUndefined(options.alias);
82067
+ const shell = yield* installShellIntegration(requested === undefined ? {} : { commandName: requested }).pipe(map5(some2), catchTag2("ShellIntegrationError", (error52) => log(`! ${error52.message}`).pipe(as2(none2()))));
82068
+ if (isSome2(shell)) {
82069
+ yield* log(`\u2713 ${shell.value.commandName} shortcut installed in ${shell.value.path}`);
82070
+ launchCommand = shell.value.commandName;
82071
+ }
82054
82072
  }
82055
82073
  yield* log(`
82056
82074
  Scan this QR code from the Agentstuff mobile app to connect this Mac:
@@ -82090,7 +82108,7 @@ var relayFlag = exports_Flag.string("relay").pipe(exports_Flag.withDescription("
82090
82108
  var resetFlag = exports_Flag.boolean("reset").pipe(exports_Flag.withDescription("Rotate the pairing channel and secret"));
82091
82109
  var rootCommand = exports_Command.make("agentstuff", {}, startHandler).pipe(exports_Command.withDescription("Continue terminal agent sessions from your phone"));
82092
82110
  var setupCommand = exports_Command.make("setup", {
82093
- alias: exports_Flag.string("alias").pipe(exports_Flag.withDefault("ac"), exports_Flag.withDescription("Shell shortcut for connected Claude sessions")),
82111
+ alias: exports_Flag.string("alias").pipe(exports_Flag.optional, exports_Flag.withDescription("Shell shortcut for connected Claude sessions")),
82094
82112
  noAlias: exports_Flag.boolean("no-alias").pipe(exports_Flag.withDescription("Do not modify the shell configuration")),
82095
82113
  relay: relayFlag,
82096
82114
  reset: resetFlag
@@ -82133,5 +82151,5 @@ if (rawCommand === "terminal" || rawCommand === "claude") {
82133
82151
  process.exitCode = exitCode;
82134
82152
  })), asVoid2));
82135
82153
  } else {
82136
- cli.pipe(exports_Command.run({ version: "0.1.0" }), provide4(exports_BunServices.layer), exports_BunRuntime.runMain);
82154
+ cli.pipe(exports_Command.run({ version: "0.1.1" }), provide4(exports_BunServices.layer), exports_BunRuntime.runMain);
82137
82155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentstuff",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Continue terminal agent sessions securely from your phone",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",