agent-yes 1.262.0 → 1.263.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.
Files changed (30) hide show
  1. package/dist/{SUPPORTED_CLIS-BFLGbQmm.js → SUPPORTED_CLIS--5E9wO4L.js} +3 -3
  2. package/dist/{SUPPORTED_CLIS-CjKxvhlh.js → SUPPORTED_CLIS-DjFlWHpg.js} +2 -2
  3. package/dist/{agentShare-LEETLOm1.js → agentShare-BP6wiu_5.js} +2 -2
  4. package/dist/{callback-lqCCgSy1.js → callback-B0PQUZcK.js} +2 -2
  5. package/dist/{callback-CB3UjryF.js → callback-DFUFLIZQ.js} +3 -3
  6. package/dist/cli.js +5 -5
  7. package/dist/index.js +2 -2
  8. package/dist/{notifyDaemon-P6Q7Eo_B.js → notifyDaemon-BskLhHdg.js} +2 -2
  9. package/dist/{rustBinary-_qRGhAa5.js → rustBinary-Borvwmya.js} +2 -2
  10. package/dist/{schedule-ChAdx2h6.js → schedule-BSEIVKQ0.js} +4 -4
  11. package/dist/{serve-DhtgWGZB.js → serve-BEdLsSpv.js} +159 -17
  12. package/dist/{setup-BlJRaODn.js → setup-DFRvZ_ku.js} +2 -2
  13. package/dist/subcommands-B1YlmRaZ.js +10 -0
  14. package/dist/{subcommands-Zk3brdKt.js → subcommands-Bo1MSwuC.js} +78 -17
  15. package/dist/{terminal-BVWhnQUf.js → terminal-BMQWojIp.js} +2 -2
  16. package/dist/{trayApp-DtThjl0_.js → trayApp-CjB5QhdV.js} +2 -2
  17. package/dist/trayApp-DrdktFnW.js +5 -0
  18. package/dist/{ts-BqaOPFCQ.js → ts-BSHR_dga.js} +2 -2
  19. package/dist/{versionChecker-D-WLKAN6.js → versionChecker-BTLZ3PAb.js} +2 -2
  20. package/dist/{widget-CJyd9t8k.js → widget-BVss0Z9Y.js} +3 -3
  21. package/dist/{ws-mG4yeZu8.js → ws-DMudFezi.js} +2 -2
  22. package/dist/{ws-Vy3mBjNm.js → ws-DxNNwnrc.js} +2 -2
  23. package/lab/ui/index.html +101 -36
  24. package/package.json +2 -1
  25. package/scripts/deepseek-codex.ts +580 -0
  26. package/ts/serve.spec.ts +36 -0
  27. package/ts/serve.ts +144 -1
  28. package/ts/subcommands.ts +109 -1
  29. package/dist/subcommands-D6O9uRvN.js +0 -10
  30. package/dist/trayApp-C6U7Hghi.js +0 -5
@@ -1,11 +1,11 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-D-WLKAN6.js";
3
- import "./ts-BqaOPFCQ.js";
2
+ import "./versionChecker-BTLZ3PAb.js";
3
+ import "./ts-BSHR_dga.js";
4
4
  import "./todoAutomation-BQRW614S.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-pwp7Vb7o.js";
7
7
  import "./pidStore-DfSm1jog.js";
8
8
  import "./messageLog-BYFwioFY.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CjKxvhlh.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DjFlWHpg.js";
10
10
 
11
11
  export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-BqaOPFCQ.js";
1
+ import { t as CLIS_CONFIG } from "./ts-BSHR_dga.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-CjKxvhlh.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-DjFlWHpg.js.map
@@ -3,7 +3,7 @@ import "./globalPidIndex-pwp7Vb7o.js";
3
3
  import "./messageLog-BYFwioFY.js";
4
4
  import "./e2e-CUMZC53I.js";
5
5
  import "./configShared-DtHMBCl7.js";
6
- import { I as resolveOne } from "./subcommands-Zk3brdKt.js";
6
+ import { L as resolveOne } from "./subcommands-Bo1MSwuC.js";
7
7
  import "./webrtcLink-CS4D-3G1.js";
8
8
  import "./remotes-Cn-wszbK.js";
9
9
  import { a as startShare } from "./share-B-e_9WBx.js";
@@ -229,4 +229,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
229
229
 
230
230
  //#endregion
231
231
  export { createScopedShare, listShares, revokeAllShares, revokeShare };
232
- //# sourceMappingURL=agentShare-LEETLOm1.js.map
232
+ //# sourceMappingURL=agentShare-BP6wiu_5.js.map
@@ -3,10 +3,10 @@ import "./globalPidIndex-pwp7Vb7o.js";
3
3
  import "./messageLog-BYFwioFY.js";
4
4
  import "./e2e-CUMZC53I.js";
5
5
  import "./configShared-DtHMBCl7.js";
6
- import "./subcommands-Zk3brdKt.js";
6
+ import "./subcommands-Bo1MSwuC.js";
7
7
  import "./webrtcLink-CS4D-3G1.js";
8
8
  import "./remotes-Cn-wszbK.js";
9
9
  import "./callbackCore-Cg3Ye0ZS.js";
10
- import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-CB3UjryF.js";
10
+ import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-DFUFLIZQ.js";
11
11
 
12
12
  export { cmdCallback };
@@ -1,5 +1,5 @@
1
1
  import { t as agentYesHome } from "./agentYesHome-CtmsY6I-.js";
2
- import { I as resolveOne } from "./subcommands-Zk3brdKt.js";
2
+ import { L as resolveOne } from "./subcommands-Bo1MSwuC.js";
3
3
  import { a as mintCapability, o as parseExpires } from "./callbackCore-Cg3Ye0ZS.js";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { chmodSync, readFileSync, renameSync, writeFileSync } from "node:fs";
@@ -72,7 +72,7 @@ async function resolveBase(flag) {
72
72
  if (flag) return flag;
73
73
  if (process.env.AGENT_YES_CALLBACK_BASE) return process.env.AGENT_YES_CALLBACK_BASE;
74
74
  try {
75
- const { resolveLocalServeUrl } = await import("./serve-DhtgWGZB.js");
75
+ const { resolveLocalServeUrl } = await import("./serve-BEdLsSpv.js");
76
76
  const url = await resolveLocalServeUrl();
77
77
  if (url) return url;
78
78
  } catch {}
@@ -187,4 +187,4 @@ async function cmdCallback(rest) {
187
187
 
188
188
  //#endregion
189
189
  export { loadOrCreateCallbackSecret as i, isCallbackRevoked as n, loadCallbackSecretReadOnly as r, cmdCallback as t };
190
- //# sourceMappingURL=callback-CB3UjryF.js.map
190
+ //# sourceMappingURL=callback-DFUFLIZQ.js.map
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-D-WLKAN6.js";
5
- import { r as getRustBinary } from "./rustBinary-_qRGhAa5.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-BTLZ3PAb.js";
5
+ import { r as getRustBinary } from "./rustBinary-Borvwmya.js";
6
6
  import { argv } from "process";
7
7
  import { spawn } from "child_process";
8
8
  import ms from "ms";
@@ -295,7 +295,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
295
295
  const rawArg = process.argv[2];
296
296
  const managerCommands = !invokedCliName(process.argv);
297
297
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
298
- const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken } = await import("./subcommands-D6O9uRvN.js");
298
+ const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken } = await import("./subcommands-B1YlmRaZ.js");
299
299
  if (isHelpFlag && process.argv.length === 3) {
300
300
  await cmdHelp(managerCommands);
301
301
  process.exit(0);
@@ -305,7 +305,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
305
305
  process.exit(code ?? 0);
306
306
  }
307
307
  {
308
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BFLGbQmm.js");
308
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS--5E9wO4L.js");
309
309
  if (isUnknownManagerToken(rawArg, managerCommands, SUPPORTED_CLIS)) {
310
310
  process.stderr.write(`ay: unknown subcommand or CLI '${rawArg}'.\n See 'ay help' for subcommands. To run an agent, name a CLI:\n 'ay <cli> …' (e.g. 'ay claude …') or 'ay --cli <cli> …'.\n`);
311
311
  process.exit(1);
@@ -356,7 +356,7 @@ if (config.useRust) {
356
356
  }
357
357
  }
358
358
  if (rustBinary) {
359
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BFLGbQmm.js");
359
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS--5E9wO4L.js");
360
360
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
361
361
  if (config.verbose) {
362
362
  console.log(`[rust] Using binary: ${rustBinary}`);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-D-WLKAN6.js";
3
- import { a as hasTodoStore, i as answerAsk, l as AgentContext, n as agentYes, o as listAsks, r as config, s as listAsksForProject, t as CLIS_CONFIG } from "./ts-BqaOPFCQ.js";
2
+ import "./versionChecker-BTLZ3PAb.js";
3
+ import { a as hasTodoStore, i as answerAsk, l as AgentContext, n as agentYes, o as listAsks, r as config, s as listAsksForProject, t as CLIS_CONFIG } from "./ts-BSHR_dga.js";
4
4
  import { _ as isKnownKind, a as renderTree, b as statesOf, c as monitorHint, d as openStore, f as DONE_STATE, g as initialState, h as canTransition, i as renderDigest, l as CycleError, m as ORPHANED_STATE, o as unblockedTasks, p as LIFECYCLES, r as openBlockers, s as describeBlock, t as reconcileTodos, u as TodoStore, v as nextStates, x as removeControlCharacters, y as requiredGate } from "./todoAutomation-BQRW614S.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-pwp7Vb7o.js";
@@ -3,7 +3,7 @@ import "./globalPidIndex-pwp7Vb7o.js";
3
3
  import "./messageLog-BYFwioFY.js";
4
4
  import "./e2e-CUMZC53I.js";
5
5
  import "./configShared-DtHMBCl7.js";
6
- import { $ as liveWatchers, J as appendEvent, N as renderLogTailLines, Q as listInboxParents, X as hostId, Y as gcInboxes, et as readInbox, it as notifyDir, l as deriveLiveState, nt as daemonLockDir, rt as daemonLockOwnerPath, tt as shouldStealLock, v as isPidAlive, w as listRecords } from "./subcommands-Zk3brdKt.js";
6
+ import { $ as listInboxParents, P as renderLogTailLines, T as listRecords, X as gcInboxes, Y as appendEvent, Z as hostId, at as notifyDir, et as liveWatchers, it as daemonLockOwnerPath, nt as shouldStealLock, rt as daemonLockDir, tt as readInbox, u as deriveLiveState, y as isPidAlive } from "./subcommands-Bo1MSwuC.js";
7
7
  import "./webrtcLink-CS4D-3G1.js";
8
8
  import "./remotes-Cn-wszbK.js";
9
9
  import { mkdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
@@ -836,4 +836,4 @@ async function ensureDaemon() {
836
836
 
837
837
  //#endregion
838
838
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
839
- //# sourceMappingURL=notifyDaemon-P6Q7Eo_B.js.map
839
+ //# sourceMappingURL=notifyDaemon-BskLhHdg.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-D-WLKAN6.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-BTLZ3PAb.js";
2
2
  import { execFileSync } from "child_process";
3
3
  import { existsSync, mkdirSync, unlinkSync } from "fs";
4
4
  import { chmod, copyFile } from "fs/promises";
@@ -243,4 +243,4 @@ async function getRustBinary(options = {}) {
243
243
 
244
244
  //#endregion
245
245
  export { findTrayLauncher as n, getRustBinary as r, findSpawnHiddenLauncher as t };
246
- //# sourceMappingURL=rustBinary-_qRGhAa5.js.map
246
+ //# sourceMappingURL=rustBinary-Borvwmya.js.map
@@ -1,12 +1,12 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-D-WLKAN6.js";
3
- import "./ts-BqaOPFCQ.js";
2
+ import "./versionChecker-BTLZ3PAb.js";
3
+ import "./ts-BSHR_dga.js";
4
4
  import "./todoAutomation-BQRW614S.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-pwp7Vb7o.js";
7
7
  import "./pidStore-DfSm1jog.js";
8
8
  import "./messageLog-BYFwioFY.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CjKxvhlh.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DjFlWHpg.js";
10
10
  import { f as resolveSpawnCwd } from "./workspaceConfig-Bxuk_MOq.js";
11
11
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-vhOBffJ3.js";
12
12
  import { createHash } from "node:crypto";
@@ -153,4 +153,4 @@ async function cmdSchedule(rest) {
153
153
 
154
154
  //#endregion
155
155
  export { cmdSchedule };
156
- //# sourceMappingURL=schedule-ChAdx2h6.js.map
156
+ //# sourceMappingURL=schedule-BSEIVKQ0.js.map
@@ -1,7 +1,7 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import { r as getInstalledPackage } from "./versionChecker-D-WLKAN6.js";
3
- import { t as findSpawnHiddenLauncher } from "./rustBinary-_qRGhAa5.js";
4
- import { c as permissionBadge, i as answerAsk, o as listAsks, u as CLAUDE_SESSION_PIN_ENV } from "./ts-BqaOPFCQ.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-BTLZ3PAb.js";
3
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-Borvwmya.js";
4
+ import { c as permissionBadge, i as answerAsk, o as listAsks, u as CLAUDE_SESSION_PIN_ENV } from "./ts-BSHR_dga.js";
5
5
  import { t as agentYesHome$1 } from "./agentYesHome-CtmsY6I-.js";
6
6
  import { x as removeControlCharacters } from "./todoAutomation-BQRW614S.js";
7
7
  import "./JsonlStore-CPGIR0Wy.js";
@@ -11,17 +11,17 @@ import { r as recordInbox } from "./messageLog-BYFwioFY.js";
11
11
  import { t as pgidForWrapper } from "./reaper-C4BvNylH.js";
12
12
  import "./e2e-CUMZC53I.js";
13
13
  import "./configShared-DtHMBCl7.js";
14
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CjKxvhlh.js";
15
- import { A as readPtysize, F as renderRawLogLines, I as resolveOne, M as recentReadEdges, N as renderLogTailLines, O as readLogForRender, P as renderRawLog, S as isUserTyping, V as snapshotStatus, Z as isTransientLockMkdirError, at as TYPING_BADGE, d as extractBadges, j as recentMessageEdges, k as readNotes, m as extractTaskCounts, p as extractNeedsInput, q as writeToIpc, s as controlCodeFromName, u as deriveLiveStatus, w as listRecords } from "./subcommands-Zk3brdKt.js";
14
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DjFlWHpg.js";
15
+ import { A as readNotes, C as isUserTyping, F as renderRawLog, H as snapshotStatus, I as renderRawLogLines, J as writeToIpc, L as resolveOne, M as recentMessageEdges, N as recentReadEdges, P as renderLogTailLines, Q as isTransientLockMkdirError, T as listRecords, c as controlCodeFromName, d as deriveLiveStatus, f as extractBadges, h as extractTaskCounts, j as readPtysize, k as readLogForRender, m as extractNeedsInput, ot as TYPING_BADGE } from "./subcommands-Bo1MSwuC.js";
16
16
  import "./webrtcLink-CS4D-3G1.js";
17
17
  import "./remotes-Cn-wszbK.js";
18
18
  import { i as frameVisitorMessage, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-Cg3Ye0ZS.js";
19
- import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-CB3UjryF.js";
19
+ import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-DFUFLIZQ.js";
20
20
  import { a as getProvisionRoot, d as isProvisionAllowed, f as resolveSpawnCwd, i as getProvisionHook, l as hasProvisionHook, o as getSpawnHook, t as allowsSkipPermissions, u as hasSpawnHook } from "./workspaceConfig-Bxuk_MOq.js";
21
21
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-vhOBffJ3.js";
22
- import { i as importProvisionModule } from "./ws-Vy3mBjNm.js";
22
+ import { i as importProvisionModule } from "./ws-DxNNwnrc.js";
23
23
  import { r as spawnRejectionReason } from "./spawnGate-D-68B907.js";
24
- import { i as launchTray } from "./trayApp-DtThjl0_.js";
24
+ import { i as launchTray } from "./trayApp-CjB5QhdV.js";
25
25
  import yargs from "yargs";
26
26
  import { appendFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "fs/promises";
27
27
  import { arch, cpus, freemem, homedir, hostname, loadavg, platform, totalmem, uptime, userInfo } from "os";
@@ -701,6 +701,36 @@ async function runCapture(argv, opts) {
701
701
  };
702
702
  }
703
703
  }
704
+ function parseGitUrl(s) {
705
+ let host = "";
706
+ let pathPart = "";
707
+ const scp = /^git@([^:/\s]+):([^\s]+?)(?:\.git)?\/?$/.exec(s);
708
+ if (scp) {
709
+ host = scp[1];
710
+ pathPart = scp[2];
711
+ } else {
712
+ let u;
713
+ try {
714
+ u = new URL(s);
715
+ } catch {
716
+ return null;
717
+ }
718
+ if (!/^(https?|ssh|git)$/.test(u.protocol.replace(":", ""))) return null;
719
+ host = u.hostname;
720
+ pathPart = u.pathname.replace(/^\/+|\/+$/g, "").replace(/\.git$/, "");
721
+ }
722
+ if (/(^|\.)github\.com$/i.test(host)) return null;
723
+ const segs = pathPart.split("/").filter(Boolean);
724
+ if (segs.length < 2) return null;
725
+ const owner = segs[segs.length - 2];
726
+ const repo = segs[segs.length - 1].replace(/\.git$/, "");
727
+ if (!owner || !repo || owner === "." || owner === ".." || repo === "." || repo === "..") return null;
728
+ return {
729
+ url: s.replace(/\/+$/, ""),
730
+ owner,
731
+ repo
732
+ };
733
+ }
704
734
  let ghRepoListMemo = null;
705
735
  async function runProvisionHook(cwd, koho) {
706
736
  const hook = getProvisionHook();
@@ -2395,7 +2425,7 @@ Options:
2395
2425
  }
2396
2426
  });
2397
2427
  if (req.method === "GET" && p === "/api/ws") {
2398
- const ws = await import("./ws-mG4yeZu8.js");
2428
+ const ws = await import("./ws-DMudFezi.js");
2399
2429
  try {
2400
2430
  await ws.loadProvision();
2401
2431
  } catch (e) {
@@ -2415,7 +2445,7 @@ Options:
2415
2445
  if (req.method === "GET" && p === "/api/ws/status") {
2416
2446
  const dirRaw = url.searchParams.get("path");
2417
2447
  if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
2418
- const ws = await import("./ws-mG4yeZu8.js");
2448
+ const ws = await import("./ws-DMudFezi.js");
2419
2449
  let prov;
2420
2450
  try {
2421
2451
  prov = await ws.loadProvision();
@@ -2437,7 +2467,7 @@ Options:
2437
2467
  }
2438
2468
  }
2439
2469
  if (req.method === "GET" && p === "/api/ws/repos") {
2440
- const ws = await import("./ws-mG4yeZu8.js");
2470
+ const ws = await import("./ws-DMudFezi.js");
2441
2471
  try {
2442
2472
  await ws.loadProvision();
2443
2473
  } catch (e) {
@@ -2518,7 +2548,7 @@ Options:
2518
2548
  const m = /^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/.exec(repoParam);
2519
2549
  if (!m || m[1] === "." || m[1] === ".." || m[2] === "." || m[2] === "..") return new Response("missing/invalid ?repo=<owner>/<repo>", { status: 400 });
2520
2550
  const [, owner, repo] = m;
2521
- const ws = await import("./ws-mG4yeZu8.js");
2551
+ const ws = await import("./ws-DMudFezi.js");
2522
2552
  let prov;
2523
2553
  try {
2524
2554
  prov = await ws.loadProvision();
@@ -3173,6 +3203,118 @@ Options:
3173
3203
  action: result.action,
3174
3204
  folder: result.folder
3175
3205
  };
3206
+ } else if (from && parseGitUrl(from)) {
3207
+ const gitSrc = parseGitUrl(from);
3208
+ const branch = typeof body.branch === "string" ? body.branch.trim() : "";
3209
+ const badBranch = (b) => b.startsWith("-") || b.split("/").some((s) => !s || s === "." || s === "..");
3210
+ if (branch && badBranch(branch)) return new Response(`invalid branch name: ${branch}`, { status: 400 });
3211
+ const gitHook = await runProvisionHook(getProvisionRoot() ?? homedir(), {
3212
+ KOHO_ACTION: "from",
3213
+ KOHO_SOURCE: from,
3214
+ KOHO_OWNER: gitSrc.owner,
3215
+ KOHO_REPO: gitSrc.repo,
3216
+ KOHO_BRANCH: branch,
3217
+ KOHO_WS_ROOT: getProvisionRoot() ?? ""
3218
+ });
3219
+ if (gitHook.ran) {
3220
+ if (!gitHook.ok) return new Response(`provision hook denied '${gitSrc.owner}/${gitSrc.repo}' (exit ${gitHook.code})` + (gitHook.detail ? `:\n${gitHook.detail}` : ""), { status: 403 });
3221
+ } else if (!isProvisionAllowed(gitSrc.owner, gitSrc.repo)) return new Response(`provisioning '${gitSrc.owner}/${gitSrc.repo}' is not allowed — add the owner to provisionAllowlist in ~/.agent-yes/config.json (or "*" to allow all), or set a provisionHook to gate it yourself`, { status: 403 });
3222
+ const wsRootDir = getProvisionRoot() ?? path.join(homedir(), "ws");
3223
+ const base = path.join(wsRootDir, gitSrc.owner, gitSrc.repo, "tree");
3224
+ const destFor = (b) => path.join(base, b);
3225
+ if (branch && existsSync(path.join(destFor(branch), ".git"))) {
3226
+ cwd = destFor(branch);
3227
+ provisioned = {
3228
+ action: "existing",
3229
+ folder: cwd
3230
+ };
3231
+ } else {
3232
+ const tmp = path.join(base, `.clone-${process.pid}-${Date.now().toString(36)}`);
3233
+ try {
3234
+ await mkdir(base, { recursive: true });
3235
+ } catch (e) {
3236
+ return new Response(`cannot create ${base}: ${e.message}`, { status: 500 });
3237
+ }
3238
+ const cloneMs = 3e5;
3239
+ let created = false;
3240
+ let r = await runCapture(branch ? [
3241
+ "git",
3242
+ "clone",
3243
+ "--branch",
3244
+ branch,
3245
+ "--",
3246
+ gitSrc.url,
3247
+ tmp
3248
+ ] : [
3249
+ "git",
3250
+ "clone",
3251
+ "--",
3252
+ gitSrc.url,
3253
+ tmp
3254
+ ], { timeoutMs: cloneMs });
3255
+ if (!r.ok && branch && body.create === true) {
3256
+ await rm(tmp, {
3257
+ recursive: true,
3258
+ force: true
3259
+ }).catch(() => {});
3260
+ r = await runCapture([
3261
+ "git",
3262
+ "clone",
3263
+ "--",
3264
+ gitSrc.url,
3265
+ tmp
3266
+ ], { timeoutMs: cloneMs });
3267
+ if (r.ok) {
3268
+ const co = await runCapture([
3269
+ "git",
3270
+ "-C",
3271
+ tmp,
3272
+ "checkout",
3273
+ "-b",
3274
+ branch
3275
+ ]);
3276
+ if (!co.ok) r = co;
3277
+ else created = true;
3278
+ }
3279
+ }
3280
+ if (!r.ok) {
3281
+ await rm(tmp, {
3282
+ recursive: true,
3283
+ force: true
3284
+ }).catch(() => {});
3285
+ return new Response(`git clone failed: ${(r.stderr.trim() || "unknown").slice(0, 500)}` + (branch && body.create !== true ? "\n(if the branch doesn't exist yet, retry with create:true)" : ""), { status: 502 });
3286
+ }
3287
+ const head = await runCapture([
3288
+ "git",
3289
+ "-C",
3290
+ tmp,
3291
+ "rev-parse",
3292
+ "--abbrev-ref",
3293
+ "HEAD"
3294
+ ]);
3295
+ let actual = branch || (head.ok ? head.stdout.trim() : "") || "main";
3296
+ if (badBranch(actual)) actual = "main";
3297
+ const dest = destFor(actual);
3298
+ if (existsSync(dest)) await rm(tmp, {
3299
+ recursive: true,
3300
+ force: true
3301
+ }).catch(() => {});
3302
+ else try {
3303
+ await mkdir(path.dirname(dest), { recursive: true });
3304
+ await rename(tmp, dest);
3305
+ } catch (e) {
3306
+ await rm(tmp, {
3307
+ recursive: true,
3308
+ force: true
3309
+ }).catch(() => {});
3310
+ return new Response(`cannot place checkout at ${dest}: ${e.message}`, { status: 500 });
3311
+ }
3312
+ cwd = dest;
3313
+ provisioned = {
3314
+ action: created ? "cloned+new-branch" : "cloned",
3315
+ folder: dest
3316
+ };
3317
+ }
3176
3318
  } else if (from) {
3177
3319
  let prov;
3178
3320
  try {
@@ -3314,7 +3456,7 @@ Options:
3314
3456
  const perm = body.perm ?? "r";
3315
3457
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
3316
3458
  try {
3317
- const { createScopedShare } = await import("./agentShare-LEETLOm1.js");
3459
+ const { createScopedShare } = await import("./agentShare-BP6wiu_5.js");
3318
3460
  const share = await createScopedShare({
3319
3461
  agent: body.agent,
3320
3462
  perm,
@@ -3329,12 +3471,12 @@ Options:
3329
3471
  }
3330
3472
  }
3331
3473
  if (req.method === "GET" && p === "/api/shares") {
3332
- const { listShares } = await import("./agentShare-LEETLOm1.js");
3474
+ const { listShares } = await import("./agentShare-BP6wiu_5.js");
3333
3475
  return Response.json(listShares());
3334
3476
  }
3335
3477
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
3336
3478
  if (req.method === "DELETE" && revokeM) {
3337
- const { revokeShare } = await import("./agentShare-LEETLOm1.js");
3479
+ const { revokeShare } = await import("./agentShare-BP6wiu_5.js");
3338
3480
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
3339
3481
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
3340
3482
  }
@@ -3636,7 +3778,7 @@ Options:
3636
3778
  const shutdown = (resolve) => {
3637
3779
  if (heartbeat) clearInterval(heartbeat);
3638
3780
  closeShare?.();
3639
- import("./agentShare-LEETLOm1.js").then((m) => m.revokeAllShares()).catch(() => {});
3781
+ import("./agentShare-BP6wiu_5.js").then((m) => m.revokeAllShares()).catch(() => {});
3640
3782
  server?.stop();
3641
3783
  Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
3642
3784
  };
@@ -3649,4 +3791,4 @@ Options:
3649
3791
 
3650
3792
  //#endregion
3651
3793
  export { cmdServe, loadTokenReadOnly, mintScopedTermToken, resolveDaemonHttpBase, resolveLocalServeUrl };
3652
- //# sourceMappingURL=serve-DhtgWGZB.js.map
3794
+ //# sourceMappingURL=serve-BEdLsSpv.js.map
@@ -40,7 +40,7 @@ async function cmdSetup(rest) {
40
40
  } catch {}
41
41
  if (noShare) return 0;
42
42
  process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
43
- const { cmdServe } = await import("./serve-DhtgWGZB.js");
43
+ const { cmdServe } = await import("./serve-BEdLsSpv.js");
44
44
  return cmdServe([
45
45
  "install",
46
46
  "--share",
@@ -50,4 +50,4 @@ async function cmdSetup(rest) {
50
50
 
51
51
  //#endregion
52
52
  export { cmdSetup };
53
- //# sourceMappingURL=setup-BlJRaODn.js.map
53
+ //# sourceMappingURL=setup-DFRvZ_ku.js.map
@@ -0,0 +1,10 @@
1
+ import "./logger-CDIsZ-Pp.js";
2
+ import "./globalPidIndex-pwp7Vb7o.js";
3
+ import "./messageLog-BYFwioFY.js";
4
+ import "./e2e-CUMZC53I.js";
5
+ import "./configShared-DtHMBCl7.js";
6
+ import { A as readNotes, B as restartHintLines, C as isUserTyping, D as menuSelectKeys, E as matchKeyword, F as renderRawLog, G as submitAndConfirm, H as snapshotStatus, I as renderRawLogLines, J as writeToIpc, K as waitForLogQuiet, L as resolveOne, M as recentMessageEdges, N as recentReadEdges, O as readAgentPtysize, P as renderLogTailLines, R as resolveReadWindow, S as isUnknownManagerToken, T as listRecords, U as stdinActivityPath, V as runSubcommand, W as stopTipForCli, _ as isAgentStuck, a as backoffWhileTyping, b as isSlashCommand, c as controlCodeFromName, d as deriveLiveStatus, f as extractBadges, g as finalizedLines, h as extractTaskCounts, i as TYPING_WINDOW_MS, j as readPtysize, k as readLogForRender, l as cursorAbs, m as extractNeedsInput, n as MAX_RENDER_BYTES, o as cmdDeepseek, p as extractMenu, q as writeKeysPaced, r as READ_PAGE_DEFAULT, s as cmdHelp, t as GRACEFUL_EXIT_COMMANDS, u as deriveLiveState, v as isExitRequest, w as lastStdinAt, x as isSubcommand, y as isPidAlive, z as resolveResumeArgs } from "./subcommands-Bo1MSwuC.js";
7
+ import "./webrtcLink-CS4D-3G1.js";
8
+ import "./remotes-Cn-wszbK.js";
9
+
10
+ export { cmdHelp, isSubcommand, isUnknownManagerToken, runSubcommand };