claude-yes 1.172.0 → 1.173.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.
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-DiMpa4ri.js";
1
+ import { t as CLIS_CONFIG } from "./ts-BWd_P2qD.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-KMkjT-Ny.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-BGNIrPNN.js.map
@@ -0,0 +1,8 @@
1
+ import "./ts-BWd_P2qD.js";
2
+ import "./logger-CDIsZ-Pp.js";
3
+ import "./versionChecker-CemZTLrY.js";
4
+ import "./pidStore-BIvsBQ8X.js";
5
+ import "./globalPidIndex-CoNr7tS8.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BGNIrPNN.js";
7
+
8
+ export { SUPPORTED_CLIS };
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bun
2
2
  import { t as invokedCliName } from "./invokedCli-uqM2YYA7.js";
3
3
  import { n as logger } from "./logger-CDIsZ-Pp.js";
4
- import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-D6Qc6O3F.js";
5
- import { n as getRustBinary } from "./rustBinary-Bne6M0ik.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-CemZTLrY.js";
5
+ import { n as getRustBinary } from "./rustBinary-DZc1nJ5b.js";
6
6
  import { argv } from "process";
7
7
  import { spawn } from "child_process";
8
8
  import ms from "ms";
@@ -285,7 +285,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
285
285
  const rawArg = process.argv[2];
286
286
  const managerCommands = !invokedCliName(process.argv);
287
287
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
288
- const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-DZtrr8ps.js");
288
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-61rF6KoP.js");
289
289
  if (isHelpFlag && process.argv.length === 3) {
290
290
  await cmdHelp(managerCommands);
291
291
  process.exit(0);
@@ -327,7 +327,7 @@ if (config.useRust) {
327
327
  }
328
328
  }
329
329
  if (rustBinary) {
330
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-oB5KxI57.js");
330
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-Dvng8mGV.js");
331
331
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
332
332
  if (config.verbose) {
333
333
  console.log(`[rust] Using binary: ${rustBinary}`);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-DiMpa4ri.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-BWd_P2qD.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-D6Qc6O3F.js";
3
+ import "./versionChecker-CemZTLrY.js";
4
4
  import "./pidStore-BIvsBQ8X.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { n as logger } from "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./configShared-0MnIQ652.js";
4
- import { D as renderLogTailLines, G as hostId, J as readInbox, K as listInboxParents, Q as notifyDir, S as listRecords, U as appendEvent, W as gcInboxes, X as daemonLockDir, Y as shouldStealLock, Z as daemonLockOwnerPath, _ as isPidAlive, c as deriveLiveState, q as liveWatchers } from "./subcommands-ZjESAcio.js";
4
+ import { D as renderLogTailLines, G as hostId, J as readInbox, K as listInboxParents, Q as notifyDir, S as listRecords, U as appendEvent, W as gcInboxes, X as daemonLockDir, Y as shouldStealLock, Z as daemonLockOwnerPath, _ as isPidAlive, c as deriveLiveState, q as liveWatchers } from "./subcommands-Ifh1JJde.js";
5
5
  import "./e2e-jb0Hp43q.js";
6
6
  import "./webrtcLink-B7REGtK2.js";
7
7
  import "./remotes-CC-4GuJb.js";
@@ -588,4 +588,4 @@ async function ensureDaemon() {
588
588
 
589
589
  //#endregion
590
590
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
591
- //# sourceMappingURL=notifyDaemon-tmytSfnS.js.map
591
+ //# sourceMappingURL=notifyDaemon-C_SMIYAH.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-D6Qc6O3F.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-CemZTLrY.js";
2
2
  import { execFileSync } from "child_process";
3
3
  import { existsSync, mkdirSync, unlinkSync } from "fs";
4
4
  import { chmod, copyFile } from "fs/promises";
@@ -225,4 +225,4 @@ async function getRustBinary(options = {}) {
225
225
 
226
226
  //#endregion
227
227
  export { getRustBinary as n, findSpawnHiddenLauncher as t };
228
- //# sourceMappingURL=rustBinary-Bne6M0ik.js.map
228
+ //# sourceMappingURL=rustBinary-DZc1nJ5b.js.map
@@ -1,9 +1,9 @@
1
- import "./ts-DiMpa4ri.js";
1
+ import "./ts-BWd_P2qD.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-D6Qc6O3F.js";
3
+ import "./versionChecker-CemZTLrY.js";
4
4
  import "./pidStore-BIvsBQ8X.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-KMkjT-Ny.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BGNIrPNN.js";
7
7
  import { d as resolveSpawnCwd } from "./workspaceConfig-BgqK-31W.js";
8
8
  import { createHash } from "node:crypto";
9
9
 
@@ -141,4 +141,4 @@ async function cmdSchedule(rest) {
141
141
 
142
142
  //#endregion
143
143
  export { cmdSchedule };
144
- //# sourceMappingURL=schedule-BrpCaCuz.js.map
144
+ //# sourceMappingURL=schedule-BRAx-pDW.js.map
@@ -1,13 +1,13 @@
1
- import "./ts-DiMpa4ri.js";
1
+ import "./ts-BWd_P2qD.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import { r as getInstalledPackage } from "./versionChecker-D6Qc6O3F.js";
4
- import { t as findSpawnHiddenLauncher } from "./rustBinary-Bne6M0ik.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-CemZTLrY.js";
4
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-DZc1nJ5b.js";
5
5
  import "./pidStore-BIvsBQ8X.js";
6
6
  import { a as updateGlobalPidStatus } from "./globalPidIndex-CoNr7tS8.js";
7
7
  import { t as pgidForWrapper } from "./reaper-CWF2_ATd.js";
8
8
  import "./configShared-0MnIQ652.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-KMkjT-Ny.js";
10
- import { A as resolveOne, E as readPtysize, F as snapshotStatus, H as TYPING_BADGE, O as renderRawLog, S as listRecords, T as readNotes, V as writeToIpc, b as isUserTyping, f as extractNeedsInput, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, u as extractBadges } from "./subcommands-ZjESAcio.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BGNIrPNN.js";
10
+ import { A as resolveOne, E as readPtysize, F as snapshotStatus, H as TYPING_BADGE, O as renderRawLog, S as listRecords, T as readNotes, V as writeToIpc, b as isUserTyping, f as extractNeedsInput, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, u as extractBadges } from "./subcommands-Ifh1JJde.js";
11
11
  import "./e2e-jb0Hp43q.js";
12
12
  import "./webrtcLink-B7REGtK2.js";
13
13
  import "./remotes-CC-4GuJb.js";
@@ -1577,4 +1577,4 @@ Options:
1577
1577
 
1578
1578
  //#endregion
1579
1579
  export { cmdServe };
1580
- //# sourceMappingURL=serve-DvO4pj5p.js.map
1580
+ //# sourceMappingURL=serve-DJFD_BAy.js.map
@@ -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-DvO4pj5p.js");
35
+ const { cmdServe } = await import("./serve-DJFD_BAy.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-DB2gMtqk.js.map
45
+ //# sourceMappingURL=setup-BYY_C8IB.js.map
@@ -1,7 +1,7 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./configShared-0MnIQ652.js";
4
- import { A as resolveOne, B as writeKeysPaced, C as matchKeyword, D as renderLogTailLines, E as readPtysize, F as snapshotStatus, I as stdinActivityPath, L as stopTipForCli, M as resolveResumeArgs, N as restartHintLines, O as renderRawLog, P as runSubcommand, R as submitAndConfirm, S as listRecords, T as readNotes, V as writeToIpc, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as resolveReadWindow, k as renderRawLogLines, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as waitForLogQuiet } from "./subcommands-ZjESAcio.js";
4
+ import { A as resolveOne, B as writeKeysPaced, C as matchKeyword, D as renderLogTailLines, E as readPtysize, F as snapshotStatus, I as stdinActivityPath, L as stopTipForCli, M as resolveResumeArgs, N as restartHintLines, O as renderRawLog, P as runSubcommand, R as submitAndConfirm, S as listRecords, T as readNotes, V as writeToIpc, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as resolveReadWindow, k as renderRawLogLines, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as waitForLogQuiet } from "./subcommands-Ifh1JJde.js";
5
5
  import "./e2e-jb0Hp43q.js";
6
6
  import "./webrtcLink-B7REGtK2.js";
7
7
  import "./remotes-CC-4GuJb.js";
@@ -1126,15 +1126,15 @@ async function runSubcommand(argv) {
1126
1126
  case "restart": return await cmdRestart(rest);
1127
1127
  case "note": return await cmdNote(rest);
1128
1128
  case "serve": {
1129
- const { cmdServe } = await import("./serve-DvO4pj5p.js");
1129
+ const { cmdServe } = await import("./serve-DJFD_BAy.js");
1130
1130
  return cmdServe(rest);
1131
1131
  }
1132
1132
  case "setup": {
1133
- const { cmdSetup } = await import("./setup-DB2gMtqk.js");
1133
+ const { cmdSetup } = await import("./setup-BYY_C8IB.js");
1134
1134
  return cmdSetup(rest);
1135
1135
  }
1136
1136
  case "schedule": {
1137
- const { cmdSchedule } = await import("./schedule-BrpCaCuz.js");
1137
+ const { cmdSchedule } = await import("./schedule-BRAx-pDW.js");
1138
1138
  return cmdSchedule(rest);
1139
1139
  }
1140
1140
  case "remote": {
@@ -3963,7 +3963,7 @@ async function cmdNotify(rest) {
3963
3963
  }
3964
3964
  const ensure = async () => {
3965
3965
  if (!argv["ensure-daemon"]) return;
3966
- const { ensureDaemon } = await import("./notifyDaemon-tmytSfnS.js");
3966
+ const { ensureDaemon } = await import("./notifyDaemon-C_SMIYAH.js");
3967
3967
  await ensureDaemon().catch(() => null);
3968
3968
  };
3969
3969
  await heartbeatWatcher(parent, selfStartedAt);
@@ -4037,7 +4037,7 @@ async function cmdNotifyCursor(args) {
4037
4037
  }
4038
4038
  async function cmdNotifyd(rest) {
4039
4039
  const sub = rest[0] ?? "status";
4040
- const daemon = await import("./notifyDaemon-tmytSfnS.js");
4040
+ const daemon = await import("./notifyDaemon-C_SMIYAH.js");
4041
4041
  switch (sub) {
4042
4042
  case "run": return daemon.runDaemon();
4043
4043
  case "once": return daemon.runDaemon({ once: true });
@@ -4064,4 +4064,4 @@ async function cmdNotifyd(rest) {
4064
4064
 
4065
4065
  //#endregion
4066
4066
  export { resolveOne as A, writeKeysPaced as B, matchKeyword as C, renderLogTailLines as D, readPtysize as E, snapshotStatus as F, hostId as G, TYPING_BADGE as H, stdinActivityPath as I, readInbox as J, listInboxParents as K, stopTipForCli as L, resolveResumeArgs as M, restartHintLines as N, renderRawLog as O, runSubcommand as P, notifyDir as Q, submitAndConfirm as R, listRecords as S, readNotes as T, appendEvent as U, writeToIpc as V, gcInboxes as W, daemonLockDir as X, shouldStealLock as Y, daemonLockOwnerPath as Z, isPidAlive as _, cmdHelp as a, isUserTyping as b, deriveLiveState as c, extractMenu as d, extractNeedsInput as f, isExitRequest as g, isAgentStuck as h, backoffWhileTyping as i, resolveReadWindow as j, renderRawLogLines as k, deriveLiveStatus as l, finalizedLines as m, READ_PAGE_DEFAULT as n, controlCodeFromName as o, extractTaskCounts as p, liveWatchers as q, TYPING_WINDOW_MS as r, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, extractBadges as u, isSlashCommand as v, menuSelectKeys as w, lastStdinAt as x, isSubcommand as y, waitForLogQuiet as z };
4067
- //# sourceMappingURL=subcommands-ZjESAcio.js.map
4067
+ //# sourceMappingURL=subcommands-Ifh1JJde.js.map
@@ -1,5 +1,5 @@
1
1
  import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
2
- import { r as getInstalledPackage } from "./versionChecker-D6Qc6O3F.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-CemZTLrY.js";
3
3
  import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CNMl13dC.js";
5
5
  import { t as PidStore } from "./pidStore-BIvsBQ8X.js";
@@ -1824,4 +1824,4 @@ function sleep(ms) {
1824
1824
 
1825
1825
  //#endregion
1826
1826
  export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
1827
- //# sourceMappingURL=ts-DiMpa4ri.js.map
1827
+ //# sourceMappingURL=ts-BWd_P2qD.js.map
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
7
7
 
8
8
  //#region package.json
9
9
  var name = "claude-yes";
10
- var version = "1.172.0";
10
+ var version = "1.173.0";
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-D6Qc6O3F.js.map
218
+ //# sourceMappingURL=versionChecker-CemZTLrY.js.map
package/lab/ui/index.html CHANGED
@@ -1399,6 +1399,59 @@
1399
1399
  display: flex;
1400
1400
  }
1401
1401
  }
1402
+ /* Terminal right-click context menu: Copy the selection or fire a
1403
+ customizable quick command (e.g. /fork [selection]). Positioned at the
1404
+ cursor via inline top/left; clamped into the viewport by JS after mount. */
1405
+ .ctxmenu {
1406
+ position: fixed;
1407
+ z-index: 40;
1408
+ min-width: 180px;
1409
+ max-width: 320px;
1410
+ padding: 4px;
1411
+ background: var(--panel);
1412
+ border: 1px solid var(--line);
1413
+ border-radius: 8px;
1414
+ box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
1415
+ font-family: var(--mono);
1416
+ font-size: 13px;
1417
+ }
1418
+ .ctxmenu-item {
1419
+ display: flex;
1420
+ align-items: baseline;
1421
+ gap: 10px;
1422
+ width: 100%;
1423
+ box-sizing: border-box;
1424
+ padding: 6px 10px;
1425
+ border: 0;
1426
+ border-radius: 5px;
1427
+ background: transparent;
1428
+ color: var(--fg);
1429
+ font: inherit;
1430
+ text-align: left;
1431
+ white-space: nowrap;
1432
+ cursor: pointer;
1433
+ }
1434
+ .ctxmenu-item:hover:not(:disabled),
1435
+ .ctxmenu-item:focus-visible {
1436
+ background: color-mix(in srgb, var(--accent) 18%, transparent);
1437
+ outline: none;
1438
+ }
1439
+ .ctxmenu-item:disabled {
1440
+ color: var(--muted);
1441
+ cursor: default;
1442
+ }
1443
+ .ctxmenu-item .ctxmenu-hint {
1444
+ margin-left: auto;
1445
+ color: var(--muted);
1446
+ font-size: 11px;
1447
+ overflow: hidden;
1448
+ text-overflow: ellipsis;
1449
+ }
1450
+ .ctxmenu-sep {
1451
+ height: 1px;
1452
+ margin: 4px 6px;
1453
+ background: var(--line);
1454
+ }
1402
1455
  </style>
1403
1456
  <link
1404
1457
  rel="stylesheet"
@@ -3030,6 +3083,210 @@
3030
3083
  alert(`Restart failed for ${who}:\n${(res && res.text) || "request failed"}`);
3031
3084
  }
3032
3085
 
3086
+ // ---- Terminal right-click menu: copy + customizable quick commands ----
3087
+ // A right-click on the terminal used to copy the selection outright. Now it
3088
+ // opens a small menu: Copy, Paste, and user-defined quick commands. A quick
3089
+ // command is a template whose `[selection]` placeholder is filled with the
3090
+ // highlighted text and sent to the agent's stdin (with a trailing Enter),
3091
+ // e.g. `/fork [selection]`. Templates live in localStorage so they survive
3092
+ // reloads and can be edited from the menu itself.
3093
+ const QUICKCMD_KEY = "ay.quickCmds";
3094
+ const DEFAULT_QUICKCMDS = [{ label: "Fork with selection", template: "/fork [selection]" }];
3095
+ function loadQuickCmds() {
3096
+ try {
3097
+ const v = JSON.parse(localStorage.getItem(QUICKCMD_KEY) || "null");
3098
+ if (Array.isArray(v))
3099
+ return v
3100
+ .filter((c) => c && typeof c.template === "string" && c.template.trim())
3101
+ .map((c) => ({ label: String(c.label || c.template), template: c.template }));
3102
+ } catch {}
3103
+ return DEFAULT_QUICKCMDS.map((c) => ({ ...c }));
3104
+ }
3105
+ function saveQuickCmds(list) {
3106
+ localStorage.setItem(QUICKCMD_KEY, JSON.stringify(list));
3107
+ }
3108
+ // Serialize/parse for the editor textarea: one `Label | template` per line.
3109
+ // A line without `|` uses the whole line as both label and template. `|` in
3110
+ // the template is preserved (we split on the FIRST separator only).
3111
+ function quickCmdsToText(list) {
3112
+ return list.map((c) => `${c.label} | ${c.template}`).join("\n");
3113
+ }
3114
+ function textToQuickCmds(text) {
3115
+ return text
3116
+ .split("\n")
3117
+ .map((line) => line.trim())
3118
+ .filter(Boolean)
3119
+ .map((line) => {
3120
+ const i = line.indexOf("|");
3121
+ if (i < 0) return { label: line, template: line };
3122
+ const label = line.slice(0, i).trim();
3123
+ const template = line.slice(i + 1).trim();
3124
+ return { label: label || template, template };
3125
+ })
3126
+ .filter((c) => c.template);
3127
+ }
3128
+
3129
+ let ctxMenuEl = null;
3130
+ function hideTermMenu() {
3131
+ if (!ctxMenuEl) return;
3132
+ ctxMenuEl.remove();
3133
+ ctxMenuEl = null;
3134
+ document.removeEventListener("pointerdown", onCtxOutside, true);
3135
+ document.removeEventListener("keydown", onCtxKey, true);
3136
+ window.removeEventListener("blur", hideTermMenu);
3137
+ window.removeEventListener("resize", hideTermMenu);
3138
+ }
3139
+ function onCtxOutside(ev) {
3140
+ if (ctxMenuEl && !ctxMenuEl.contains(ev.target)) hideTermMenu();
3141
+ }
3142
+ function onCtxKey(ev) {
3143
+ if (ev.key === "Escape") {
3144
+ ev.preventDefault();
3145
+ hideTermMenu();
3146
+ }
3147
+ }
3148
+ // Fill `[selection]` and dispatch the command to the active agent's stdin.
3149
+ // A trailing Enter submits it (these are "quick commands", not drafts). The
3150
+ // selection is cleared so the highlight doesn't linger after firing.
3151
+ function runQuickCmd(cmd, selText, term) {
3152
+ const text = String(cmd.template).replace(/\[selection\]/g, selText || "");
3153
+ sendToSelected(text + "\r");
3154
+ try {
3155
+ term && term.clearSelection && term.clearSelection();
3156
+ } catch {}
3157
+ }
3158
+ function showTermMenu(ev, term) {
3159
+ ev.preventDefault();
3160
+ hideTermMenu();
3161
+ const selText = term && term.hasSelection && term.hasSelection() ? term.getSelection() : "";
3162
+ const menu = document.createElement("div");
3163
+ menu.className = "ctxmenu";
3164
+ menu.setAttribute("role", "menu");
3165
+ const addItem = (label, opts, onClick) => {
3166
+ const it = document.createElement("button");
3167
+ it.type = "button";
3168
+ it.className = "ctxmenu-item";
3169
+ it.textContent = label;
3170
+ it.setAttribute("role", "menuitem");
3171
+ if (opts && opts.hint) {
3172
+ const h = document.createElement("span");
3173
+ h.className = "ctxmenu-hint";
3174
+ h.textContent = opts.hint;
3175
+ it.appendChild(h);
3176
+ }
3177
+ if (opts && opts.disabled) it.disabled = true;
3178
+ else
3179
+ it.addEventListener("click", () => {
3180
+ hideTermMenu();
3181
+ onClick();
3182
+ });
3183
+ menu.appendChild(it);
3184
+ return it;
3185
+ };
3186
+ const addSep = () => {
3187
+ const s = document.createElement("div");
3188
+ s.className = "ctxmenu-sep";
3189
+ menu.appendChild(s);
3190
+ };
3191
+
3192
+ // Copy: disabled with nothing selected (mirrors the old behavior, minus
3193
+ // the auto-copy — the user now chooses it explicitly).
3194
+ addItem("Copy", { disabled: !selText }, () => {
3195
+ if (selText && navigator.clipboard)
3196
+ navigator.clipboard.writeText(selText).then(
3197
+ () => term.clearSelection(),
3198
+ () => {},
3199
+ );
3200
+ });
3201
+ // Paste: best-effort; readText is gated behind a permission prompt and is
3202
+ // undefined over plain HTTP, so hide it when unavailable.
3203
+ if (navigator.clipboard && navigator.clipboard.readText)
3204
+ addItem("Paste", {}, async () => {
3205
+ try {
3206
+ const t = await navigator.clipboard.readText();
3207
+ if (t) sendToSelected(t);
3208
+ } catch {}
3209
+ });
3210
+
3211
+ const cmds = loadQuickCmds();
3212
+ if (cmds.length) {
3213
+ addSep();
3214
+ for (const cmd of cmds)
3215
+ addItem(cmd.label, { hint: selText ? "[sel]" : "" }, () =>
3216
+ runQuickCmd(cmd, selText, term),
3217
+ );
3218
+ }
3219
+ addSep();
3220
+ addItem("Edit quick commands…", {}, editQuickCmds);
3221
+
3222
+ document.body.appendChild(menu);
3223
+ ctxMenuEl = menu;
3224
+ // Clamp into the viewport so a right-click near an edge stays fully visible.
3225
+ const r = menu.getBoundingClientRect();
3226
+ const x = Math.max(4, Math.min(ev.clientX, window.innerWidth - r.width - 4));
3227
+ const y = Math.max(4, Math.min(ev.clientY, window.innerHeight - r.height - 4));
3228
+ menu.style.left = x + "px";
3229
+ menu.style.top = y + "px";
3230
+ document.addEventListener("pointerdown", onCtxOutside, true);
3231
+ document.addEventListener("keydown", onCtxKey, true);
3232
+ window.addEventListener("blur", hideTermMenu);
3233
+ window.addEventListener("resize", hideTermMenu);
3234
+ }
3235
+ // Lightweight editor: overlay + textarea of `Label | template` lines. Save
3236
+ // writes localStorage; Reset restores the built-in defaults.
3237
+ function editQuickCmds() {
3238
+ hideTermMenu();
3239
+ const overlay = document.createElement("div");
3240
+ overlay.className = "launchoverlay";
3241
+ overlay.style.zIndex = "41";
3242
+ const box = document.createElement("div");
3243
+ box.className = "omnibox";
3244
+ box.style.padding = "16px";
3245
+ box.style.width = "min(560px, 92vw)";
3246
+ box.innerHTML =
3247
+ '<div style="color:var(--fg);font-size:14px;margin-bottom:6px">Quick commands</div>' +
3248
+ '<div style="color:var(--muted);font-size:12px;margin-bottom:10px">One per line: <code>Label | template</code>. Use <code>[selection]</code> for the highlighted text, e.g. <code>/fork [selection]</code>.</div>';
3249
+ const ta = document.createElement("textarea");
3250
+ ta.value = quickCmdsToText(loadQuickCmds());
3251
+ ta.spellcheck = false;
3252
+ ta.style.cssText =
3253
+ "width:100%;box-sizing:border-box;height:180px;resize:vertical;background:var(--bg);color:var(--fg);border:1px solid var(--line);border-radius:6px;padding:10px;font:13px var(--mono);outline:none";
3254
+ box.appendChild(ta);
3255
+ const row = document.createElement("div");
3256
+ row.style.cssText = "display:flex;gap:8px;justify-content:flex-end;margin-top:12px";
3257
+ const mkBtn = (label, primary) => {
3258
+ const b = document.createElement("button");
3259
+ b.type = "button";
3260
+ b.textContent = label;
3261
+ b.style.cssText =
3262
+ "padding:7px 14px;border-radius:6px;font:13px var(--mono);cursor:pointer;border:1px solid var(--line);" +
3263
+ (primary
3264
+ ? "background:var(--accent);color:#fff;border-color:var(--accent)"
3265
+ : "background:var(--panel2);color:var(--fg)");
3266
+ row.appendChild(b);
3267
+ return b;
3268
+ };
3269
+ const close = () => overlay.remove();
3270
+ mkBtn("Reset", false).addEventListener("click", () => {
3271
+ ta.value = quickCmdsToText(DEFAULT_QUICKCMDS);
3272
+ });
3273
+ mkBtn("Cancel", false).addEventListener("click", close);
3274
+ mkBtn("Save", true).addEventListener("click", () => {
3275
+ saveQuickCmds(textToQuickCmds(ta.value));
3276
+ close();
3277
+ });
3278
+ box.appendChild(row);
3279
+ overlay.appendChild(box);
3280
+ overlay.addEventListener("pointerdown", (ev) => {
3281
+ if (ev.target === overlay) close();
3282
+ });
3283
+ overlay.addEventListener("keydown", (ev) => {
3284
+ if (ev.key === "Escape") close();
3285
+ });
3286
+ document.body.appendChild(overlay);
3287
+ ta.focus();
3288
+ }
3289
+
3033
3290
  // ---- On-screen key bar (mobile) -------------------------------------
3034
3291
  // A phone keyboard has no Esc/Tab/Ctrl/arrows, so agent TUIs (claude,
3035
3292
  // codex, vim…) are otherwise undriveable. The bar posts raw byte
@@ -3753,24 +4010,14 @@
3753
4010
  /* addon CDN blocked — terminal still works, just without auto-links */
3754
4011
  }
3755
4012
  term.open(logEl);
3756
- // Right-click to copy the current selection (terminal convention): when
3757
- // text is selected, a context-menu click copies it to the clipboard and
3758
- // suppresses the browser menu, then clears the selection so the highlight
3759
- // doesn't linger. With nothing selected we leave the default menu alone
3760
- // (and a mouse-tracking TUI still gets its own right-click via xterm).
3761
- // The Clipboard API is undefined over plain HTTP and can reject on a
3762
- // permission denial — only suppress the menu when we can actually copy,
3763
- // clear the selection once the write resolves, and swallow a failure
3764
- // quietly (the highlight stays so the user can retry).
4013
+ // Right-click opens our own menu (Copy / Paste / customizable quick
4014
+ // commands like `/fork [selection]`) instead of copying outright. We
4015
+ // always suppress the browser's native menu here so the custom one shows
4016
+ // even with nothing selected (Copy just renders disabled). showTermMenu
4017
+ // clamps itself into the viewport and dismisses on outside click / Esc.
3765
4018
  term.element?.addEventListener("contextmenu", (ev) => {
3766
- if (!term || !term.hasSelection()) return;
3767
- const text = term.getSelection();
3768
- if (!text || !navigator.clipboard) return;
3769
- ev.preventDefault();
3770
- navigator.clipboard.writeText(text).then(
3771
- () => term.clearSelection(),
3772
- () => {},
3773
- );
4019
+ if (!term) return;
4020
+ showTermMenu(ev, term);
3774
4021
  });
3775
4022
  // On a phone, auto-focusing yanks up the soft keyboard the moment you open
3776
4023
  // an agent — even when you only meant to read the tail. Skip it there; a tap
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-yes",
3
- "version": "1.172.0",
3
+ "version": "1.173.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",
@@ -1,8 +0,0 @@
1
- import "./ts-DiMpa4ri.js";
2
- import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-D6Qc6O3F.js";
4
- import "./pidStore-BIvsBQ8X.js";
5
- import "./globalPidIndex-CoNr7tS8.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-KMkjT-Ny.js";
7
-
8
- export { SUPPORTED_CLIS };