acryl 0.1.12 → 0.1.14

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/lib/bin.js CHANGED
@@ -5343,6 +5343,7 @@ function parseAcrylArgs(args) {
5343
5343
  let resumeSessionId;
5344
5344
  let json = false;
5345
5345
  let version = false;
5346
+ let help = false;
5346
5347
  for (let index = 0; index < args.length; index += 1) {
5347
5348
  const argument = args[index];
5348
5349
  if (argument === void 0) continue;
@@ -5351,6 +5352,11 @@ function parseAcrylArgs(args) {
5351
5352
  version = true;
5352
5353
  continue;
5353
5354
  }
5355
+ if (argument === "--help" || argument === "-h") {
5356
+ if (help) throw new Error("--help may be provided only once");
5357
+ help = true;
5358
+ continue;
5359
+ }
5354
5360
  if (argument === "--profile") {
5355
5361
  if (profile !== void 0) throw new Error("--profile may be provided only once");
5356
5362
  const value = args[index + 1];
@@ -5382,15 +5388,17 @@ function parseAcrylArgs(args) {
5382
5388
  throw new Error(`unexpected argument for ${command}: ${argument}`);
5383
5389
  }
5384
5390
  const resolvedCommand = command ?? "tui";
5385
- if (!version && profile === void 0 && resumeSessionId === void 0) return {
5391
+ if (!version && !help && profile === void 0 && resumeSessionId === void 0) return {
5386
5392
  command: resolvedCommand,
5387
5393
  json,
5388
- version
5394
+ version,
5395
+ help
5389
5396
  };
5390
5397
  return {
5391
5398
  command: resolvedCommand,
5392
5399
  json,
5393
5400
  version,
5401
+ help,
5394
5402
  ...profile === void 0 ? {} : { profile },
5395
5403
  ...resumeSessionId === void 0 ? {} : { resumeSessionId }
5396
5404
  };
@@ -5440,6 +5448,27 @@ async function runAcryl(args, supplied = {}) {
5440
5448
  ...supplied
5441
5449
  };
5442
5450
  const invocation = parseAcrylArgs(args);
5451
+ if (invocation.help) {
5452
+ dependencies.write([
5453
+ "ACRYL - Agent Context Relay Yielding Lifecycles",
5454
+ "",
5455
+ `Usage: acryl [command] [options]`,
5456
+ "",
5457
+ "Commands:",
5458
+ " tui Run the terminal client (default)",
5459
+ " web Serve the local ACRYL web runtime",
5460
+ " gui [reserved] launch the Desktop surface (not wired in this build)",
5461
+ "",
5462
+ "Options:",
5463
+ " -h, --help Show this help",
5464
+ " -v, --version Print the ACRYL version",
5465
+ " --json Emit machine-readable output",
5466
+ " --profile <name> Use a named ACRYL profile",
5467
+ " --resume <id> Resume a session",
5468
+ ""
5469
+ ].join("\n"));
5470
+ return;
5471
+ }
5443
5472
  if (invocation.version) {
5444
5473
  dependencies.write(ACRYL_VERSION);
5445
5474
  return;
@@ -5506,3 +5535,5 @@ if (isEntrypoint()) (async () => {
5506
5535
  });
5507
5536
  //#endregion
5508
5537
  export { parseAcrylArgs, runAcryl };
5538
+
5539
+ //# sourceMappingURL=bin.js.map