agent-yes 1.292.0 → 1.293.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/README.md +2 -0
- package/dist/{SUPPORTED_CLIS-BfM59Xpj.js → SUPPORTED_CLIS-CB98L1zH.js} +2 -2
- package/dist/{SUPPORTED_CLIS-BDLK4Ezp.js → SUPPORTED_CLIS-rDJ9wt_4.js} +3 -3
- package/dist/{agentShare-BU4Mkg55.js → agentShare-DAKBVsJX.js} +3 -3
- package/dist/{callback-Bw5PmAIq.js → callback-BXGJ2Lao.js} +3 -3
- package/dist/{callback-7gzaW-65.js → callback-CsUXaJ-G.js} +3 -3
- package/dist/cli.js +7 -7
- package/dist/{cmdPs-DHYXWzXx.js → cmdPs-BPiWShcv.js} +3 -3
- package/dist/index.js +2 -2
- package/dist/{notifyDaemon-DLqQeAti.js → notifyDaemon-B_0fzPev.js} +3 -3
- package/dist/{parentPingLoop-H6V7_qIA.js → parentPingLoop-BRhzqYJ-.js} +2 -2
- package/dist/{remotes-tmKwrr20.js → remotes-5P__pAXA.js} +2 -2
- package/dist/{remotes-wPL0JtBs.js → remotes-CY69MeQB.js} +1 -1
- package/dist/{rustBinary-CK3xoBVr.js → rustBinary-BOZV2IrF.js} +21 -3
- package/dist/rustBinary-ByeLQphl.js +4 -0
- package/dist/{schedule-CVeX3FUy.js → schedule-D_ZH65el.js} +4 -4
- package/dist/{serve-Cek2eJS-.js → serve-CplhD9SY.js} +59 -18
- package/dist/serveRust-DDQiZmMf.js +127 -0
- package/dist/{setup-ERJSELGI.js → setup-CYFWwZAl.js} +3 -3
- package/dist/{subcommands-O-CiI-D5.js → subcommands-CZZ-l7le.js} +19 -19
- package/dist/{subcommands-CSAgQgag.js → subcommands-bVPnXbfj.js} +2 -2
- package/dist/{systemPathLink-BVdk48Vz.js → systemPathLink-VV-Vm6y2.js} +1 -1
- package/dist/{terminal-CPxIAJy_.js → terminal-BufLgBpW.js} +2 -2
- package/dist/{todoCli-DSQXAcwA.js → todoCli-BDttv8mk.js} +1 -1
- package/dist/{tray-CIt9mCKZ.js → tray-DWWsVS7Y.js} +1 -1
- package/dist/{trayApp-xQpwYUxK.js → trayApp-BfUc_4-h.js} +2 -2
- package/dist/trayApp-CfVKFhYn.js +5 -0
- package/dist/{ts--tcZ9vtp.js → ts-CPqeQSS8.js} +3 -3
- package/dist/{versionChecker-CLOLbs5d.js → versionChecker-CqLkSVM1.js} +2 -2
- package/dist/{webrtcRemote-yvMYsij3.js → webrtcRemote-0RGrSwqd.js} +1 -1
- package/dist/{widget-B2YAkIhz.js → widget-DTq1SAWM.js} +3 -3
- package/dist/{ws-DRO7LfQQ.js → ws-BxmJb-CE.js} +2 -2
- package/dist/{ws-BZdG-J-R.js → ws-CJompjqD.js} +3 -3
- package/package.json +1 -1
- package/ts/rustBinary.ts +22 -0
- package/ts/serve.ts +51 -0
- package/ts/serveRust.spec.ts +85 -0
- package/ts/serveRust.ts +114 -0
- package/dist/rustBinary-D9wbtLuv.js +0 -4
- package/dist/trayApp-oPSkAWLK.js +0 -5
|
@@ -8,7 +8,7 @@ import { n as localHost, r as localUser, t as formatIdentity } from "./identity-
|
|
|
8
8
|
import { n as isWorkingScreen, r as parseMenu, t as classifyNeedsInput } from "./needsInput-BHopZGM8.js";
|
|
9
9
|
import { S as postmortemStartedAt, _ as filterSinceSeq, a as getCursor, b as maxSeq, f as readInbox, o as heartbeatWatcher, p as setCursor, r as clearWatcher, s as hostId, v as filterSinceTs, y as filterUnread } from "./notifyStore-2SWKGwZI.js";
|
|
10
10
|
import { n as isWebrtcSpec } from "./webrtcLink-CnQf9pmu.js";
|
|
11
|
-
import { a as resolveRemoteSpec, i as readRemotes } from "./remotes-
|
|
11
|
+
import { a as resolveRemoteSpec, i as readRemotes } from "./remotes-5P__pAXA.js";
|
|
12
12
|
import { execFile } from "child_process";
|
|
13
13
|
import ms from "ms";
|
|
14
14
|
import yargs from "yargs";
|
|
@@ -1546,7 +1546,7 @@ async function runSubcommand(argv) {
|
|
|
1546
1546
|
switch (sub) {
|
|
1547
1547
|
case "ls":
|
|
1548
1548
|
case "list": return await cmdLs(rest);
|
|
1549
|
-
case "ps": return await (await import("./cmdPs-
|
|
1549
|
+
case "ps": return await (await import("./cmdPs-BPiWShcv.js")).cmdPs(rest);
|
|
1550
1550
|
case "status": return await cmdStatus(rest);
|
|
1551
1551
|
case "whoami": return await cmdWhoami(rest);
|
|
1552
1552
|
case "result": return await cmdResult(rest);
|
|
@@ -1584,7 +1584,7 @@ async function runSubcommand(argv) {
|
|
|
1584
1584
|
return sub === "ask" ? await runAskSubcommand(rest, deps) : await runAnswerSubcommand(rest, deps);
|
|
1585
1585
|
}
|
|
1586
1586
|
case "todo": {
|
|
1587
|
-
const { runTodoSubcommand } = await import("./todoCli-
|
|
1587
|
+
const { runTodoSubcommand } = await import("./todoCli-BDttv8mk.js");
|
|
1588
1588
|
return runTodoSubcommand(rest);
|
|
1589
1589
|
}
|
|
1590
1590
|
case "ch":
|
|
@@ -1593,39 +1593,39 @@ async function runSubcommand(argv) {
|
|
|
1593
1593
|
return cmdCh(rest);
|
|
1594
1594
|
}
|
|
1595
1595
|
case "term": {
|
|
1596
|
-
const { cmdTerm } = await import("./terminal-
|
|
1596
|
+
const { cmdTerm } = await import("./terminal-BufLgBpW.js");
|
|
1597
1597
|
return cmdTerm(rest);
|
|
1598
1598
|
}
|
|
1599
1599
|
case "widget": {
|
|
1600
|
-
const { cmdWidget } = await import("./widget-
|
|
1600
|
+
const { cmdWidget } = await import("./widget-DTq1SAWM.js");
|
|
1601
1601
|
return cmdWidget(rest);
|
|
1602
1602
|
}
|
|
1603
1603
|
case "mint": {
|
|
1604
|
-
const { cmdMint } = await import("./widget-
|
|
1604
|
+
const { cmdMint } = await import("./widget-DTq1SAWM.js");
|
|
1605
1605
|
return cmdMint(rest);
|
|
1606
1606
|
}
|
|
1607
1607
|
case "serve": {
|
|
1608
|
-
const { cmdServe } = await import("./serve-
|
|
1608
|
+
const { cmdServe } = await import("./serve-CplhD9SY.js");
|
|
1609
1609
|
return cmdServe(rest);
|
|
1610
1610
|
}
|
|
1611
1611
|
case "tray": {
|
|
1612
|
-
const { cmdTray } = await import("./trayApp-
|
|
1612
|
+
const { cmdTray } = await import("./trayApp-CfVKFhYn.js");
|
|
1613
1613
|
return cmdTray(rest);
|
|
1614
1614
|
}
|
|
1615
1615
|
case "setup": {
|
|
1616
|
-
const { cmdSetup } = await import("./setup-
|
|
1616
|
+
const { cmdSetup } = await import("./setup-CYFWwZAl.js");
|
|
1617
1617
|
return cmdSetup(rest);
|
|
1618
1618
|
}
|
|
1619
1619
|
case "ws": {
|
|
1620
|
-
const { cmdWs } = await import("./ws-
|
|
1620
|
+
const { cmdWs } = await import("./ws-CJompjqD.js");
|
|
1621
1621
|
return cmdWs(rest);
|
|
1622
1622
|
}
|
|
1623
1623
|
case "schedule": {
|
|
1624
|
-
const { cmdSchedule } = await import("./schedule-
|
|
1624
|
+
const { cmdSchedule } = await import("./schedule-D_ZH65el.js");
|
|
1625
1625
|
return cmdSchedule(rest);
|
|
1626
1626
|
}
|
|
1627
1627
|
case "remote": {
|
|
1628
|
-
const { cmdRemote } = await import("./remotes-
|
|
1628
|
+
const { cmdRemote } = await import("./remotes-CY69MeQB.js");
|
|
1629
1629
|
return cmdRemote(rest);
|
|
1630
1630
|
}
|
|
1631
1631
|
case "expose": {
|
|
@@ -1633,7 +1633,7 @@ async function runSubcommand(argv) {
|
|
|
1633
1633
|
return cmdExpose(rest);
|
|
1634
1634
|
}
|
|
1635
1635
|
case "callback": {
|
|
1636
|
-
const { cmdCallback } = await import("./callback-
|
|
1636
|
+
const { cmdCallback } = await import("./callback-BXGJ2Lao.js");
|
|
1637
1637
|
return cmdCallback(rest);
|
|
1638
1638
|
}
|
|
1639
1639
|
case "reap":
|
|
@@ -1644,7 +1644,7 @@ async function runSubcommand(argv) {
|
|
|
1644
1644
|
return await cmdDsh(rest);
|
|
1645
1645
|
}
|
|
1646
1646
|
case "gc": {
|
|
1647
|
-
const { gcOldBinaryDirs } = await import("./rustBinary-
|
|
1647
|
+
const { gcOldBinaryDirs } = await import("./rustBinary-ByeLQphl.js");
|
|
1648
1648
|
const { gcLogs } = await import("./globalPidIndex-DC93JhHQ.js");
|
|
1649
1649
|
const bins = gcOldBinaryDirs();
|
|
1650
1650
|
const logs = await gcLogs();
|
|
@@ -2106,7 +2106,7 @@ async function fetchRemoteRecordsRaw(url, token, opts, onReachable) {
|
|
|
2106
2106
|
let base = url;
|
|
2107
2107
|
let bearer = token;
|
|
2108
2108
|
if (isWebrtcSpec(url)) {
|
|
2109
|
-
const { startWebrtcBridge } = await import("./webrtcRemote-
|
|
2109
|
+
const { startWebrtcBridge } = await import("./webrtcRemote-0RGrSwqd.js");
|
|
2110
2110
|
bridge = await startWebrtcBridge(url);
|
|
2111
2111
|
base = bridge.baseUrl;
|
|
2112
2112
|
bearer = bridge.token;
|
|
@@ -4351,7 +4351,7 @@ async function cmdAttach(rest) {
|
|
|
4351
4351
|
const winsizeDir = path.join(ayHome, "winsize");
|
|
4352
4352
|
await mkdir(winsizeDir, { recursive: true });
|
|
4353
4353
|
const winsizePath = path.join(winsizeDir, String(record.pid));
|
|
4354
|
-
const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-
|
|
4354
|
+
const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-CplhD9SY.js");
|
|
4355
4355
|
const daemonBase = await resolveDaemonHttpBase().catch(() => null);
|
|
4356
4356
|
const daemonToken = daemonBase ? await loadTokenReadOnly().catch(() => null) ?? "" : "";
|
|
4357
4357
|
const capViewer = `attach:${process.pid}`;
|
|
@@ -5078,7 +5078,7 @@ async function cmdNotify(rest) {
|
|
|
5078
5078
|
}
|
|
5079
5079
|
const ensure = async () => {
|
|
5080
5080
|
if (!argv["ensure-daemon"]) return;
|
|
5081
|
-
const { ensureDaemon } = await import("./notifyDaemon-
|
|
5081
|
+
const { ensureDaemon } = await import("./notifyDaemon-B_0fzPev.js");
|
|
5082
5082
|
await ensureDaemon().catch(() => null);
|
|
5083
5083
|
};
|
|
5084
5084
|
await heartbeatWatcher(parent, selfStartedAt);
|
|
@@ -5152,7 +5152,7 @@ async function cmdNotifyCursor(args) {
|
|
|
5152
5152
|
}
|
|
5153
5153
|
async function cmdNotifyd(rest) {
|
|
5154
5154
|
const sub = rest[0] ?? "status";
|
|
5155
|
-
const daemon = await import("./notifyDaemon-
|
|
5155
|
+
const daemon = await import("./notifyDaemon-B_0fzPev.js");
|
|
5156
5156
|
switch (sub) {
|
|
5157
5157
|
case "run": return daemon.runDaemon();
|
|
5158
5158
|
case "once": return daemon.runDaemon({ once: true });
|
|
@@ -5179,4 +5179,4 @@ async function cmdNotifyd(rest) {
|
|
|
5179
5179
|
|
|
5180
5180
|
//#endregion
|
|
5181
5181
|
export { sendPayloadCapError as $, isUnknownManagerToken as A, readLogForRender as B, finalizedLines as C, isPidAlive as D, isExitRequest as E, listRecords as F, renderLogTailLines as G, readPtysize as H, matchKeyword as I, resolveOne as J, renderRawLog as K, menuSelectKeys as L, isUserTyping as M, lastReadAt as N, isSlashCommand as O, lastStdinAt as P, runSubcommand as Q, probeStdinReachable as R, extractTaskCounts as S, isBareManagerInvocation as T, recentMessageEdges as U, readNotes as V, recentReadEdges as W, resolveResumeArgs as X, resolveReadWindow as Y, restartHintLines as Z, envelopeAttribution as _, SEND_BODY_MAX_CHARS as a, writeKeysPaced as at, extractMenu as b, backoffWhileTyping as c, framePaste as ct, cmdHelp as d, buildAgentForest as dt, snapshotStatus as et, confirmStdinUnreachable as f, flattenForest as ft, deriveLiveStatus as g, deriveLiveState as h, READ_WINDOW_MS as i, waitForLogQuiet as it, isUnreachableWriteErrno as j, isSubcommand as k, buildEnvelope as l, shouldFramePaste as lt, cursorAbs as m, MAX_RENDER_BYTES as n, stopTipForCli as nt, SEND_EXIT_UNREACHABLE as o, writeToIpc as ot, controlCodeFromName as p, renderRawLogLines as q, READ_PAGE_DEFAULT as r, submitAndConfirm as rt, TYPING_WINDOW_MS as s, withIpcLock as st, GRACEFUL_EXIT_COMMANDS as t, stdinActivityPath as tt, cliDefaults as u, TYPING_BADGE as ut, envelopeCostFor as v, isAgentStuck as w, extractNeedsInput as x, extractBadges as y, readAgentPtysize as z };
|
|
5182
|
-
//# sourceMappingURL=subcommands-
|
|
5182
|
+
//# sourceMappingURL=subcommands-CZZ-l7le.js.map
|
|
@@ -5,9 +5,9 @@ import "./pidStore-DXWqzTSz.js";
|
|
|
5
5
|
import "./messageLog-Brx3w6zT.js";
|
|
6
6
|
import "./e2e-z1xpwSAg.js";
|
|
7
7
|
import "./configShared-DKTgiz7K.js";
|
|
8
|
-
import { $ as sendPayloadCapError, A as isUnknownManagerToken, B as readLogForRender, C as finalizedLines, D as isPidAlive, E as isExitRequest, F as listRecords, G as renderLogTailLines, H as readPtysize, I as matchKeyword, J as resolveOne, K as renderRawLog, L as menuSelectKeys, M as isUserTyping, N as lastReadAt, O as isSlashCommand, P as lastStdinAt, Q as runSubcommand, R as probeStdinReachable, S as extractTaskCounts, T as isBareManagerInvocation, U as recentMessageEdges, V as readNotes, W as recentReadEdges, X as resolveResumeArgs, Y as resolveReadWindow, Z as restartHintLines, _ as envelopeAttribution, a as SEND_BODY_MAX_CHARS, at as writeKeysPaced, b as extractMenu, c as backoffWhileTyping, d as cmdHelp, et as snapshotStatus, f as confirmStdinUnreachable, g as deriveLiveStatus, h as deriveLiveState, i as READ_WINDOW_MS, it as waitForLogQuiet, j as isUnreachableWriteErrno, k as isSubcommand, l as buildEnvelope, m as cursorAbs, n as MAX_RENDER_BYTES, nt as stopTipForCli, o as SEND_EXIT_UNREACHABLE, ot as writeToIpc, p as controlCodeFromName, q as renderRawLogLines, r as READ_PAGE_DEFAULT, rt as submitAndConfirm, s as TYPING_WINDOW_MS, t as GRACEFUL_EXIT_COMMANDS, tt as stdinActivityPath, u as cliDefaults, v as envelopeCostFor, w as isAgentStuck, x as extractNeedsInput, y as extractBadges, z as readAgentPtysize } from "./subcommands-
|
|
8
|
+
import { $ as sendPayloadCapError, A as isUnknownManagerToken, B as readLogForRender, C as finalizedLines, D as isPidAlive, E as isExitRequest, F as listRecords, G as renderLogTailLines, H as readPtysize, I as matchKeyword, J as resolveOne, K as renderRawLog, L as menuSelectKeys, M as isUserTyping, N as lastReadAt, O as isSlashCommand, P as lastStdinAt, Q as runSubcommand, R as probeStdinReachable, S as extractTaskCounts, T as isBareManagerInvocation, U as recentMessageEdges, V as readNotes, W as recentReadEdges, X as resolveResumeArgs, Y as resolveReadWindow, Z as restartHintLines, _ as envelopeAttribution, a as SEND_BODY_MAX_CHARS, at as writeKeysPaced, b as extractMenu, c as backoffWhileTyping, d as cmdHelp, et as snapshotStatus, f as confirmStdinUnreachable, g as deriveLiveStatus, h as deriveLiveState, i as READ_WINDOW_MS, it as waitForLogQuiet, j as isUnreachableWriteErrno, k as isSubcommand, l as buildEnvelope, m as cursorAbs, n as MAX_RENDER_BYTES, nt as stopTipForCli, o as SEND_EXIT_UNREACHABLE, ot as writeToIpc, p as controlCodeFromName, q as renderRawLogLines, r as READ_PAGE_DEFAULT, rt as submitAndConfirm, s as TYPING_WINDOW_MS, t as GRACEFUL_EXIT_COMMANDS, tt as stdinActivityPath, u as cliDefaults, v as envelopeCostFor, w as isAgentStuck, x as extractNeedsInput, y as extractBadges, z as readAgentPtysize } from "./subcommands-CZZ-l7le.js";
|
|
9
9
|
import "./notifyStore-2SWKGwZI.js";
|
|
10
10
|
import "./webrtcLink-CnQf9pmu.js";
|
|
11
|
-
import "./remotes-
|
|
11
|
+
import "./remotes-5P__pAXA.js";
|
|
12
12
|
|
|
13
13
|
export { READ_WINDOW_MS, cmdHelp, isBareManagerInvocation, isSubcommand, isUnknownManagerToken, lastReadAt, runSubcommand };
|
|
@@ -98,7 +98,7 @@ async function cmdTermMint(args) {
|
|
|
98
98
|
if (flags.ro && flags.interactive) throw new Error("--ro and --interactive are mutually exclusive");
|
|
99
99
|
const ttlSec = parseTtlSec(typeof flags.ttl === "string" ? flags.ttl : "15m");
|
|
100
100
|
const canSend = flags.interactive === true;
|
|
101
|
-
const { mintScopedTermToken } = await import("./serve-
|
|
101
|
+
const { mintScopedTermToken } = await import("./serve-CplhD9SY.js");
|
|
102
102
|
const r = await mintScopedTermToken(pid, {
|
|
103
103
|
ttlSec,
|
|
104
104
|
canSend
|
|
@@ -135,4 +135,4 @@ async function cmdTerm(args) {
|
|
|
135
135
|
|
|
136
136
|
//#endregion
|
|
137
137
|
export { cmdTerm };
|
|
138
|
-
//# sourceMappingURL=terminal-
|
|
138
|
+
//# sourceMappingURL=terminal-BufLgBpW.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as findTrayLauncher } from "./rustBinary-BOZV2IrF.js";
|
|
2
2
|
import { t as agentYesHome } from "./agentYesHome-BNtn19J4.js";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
@@ -97,4 +97,4 @@ async function cmdTray(args) {
|
|
|
97
97
|
|
|
98
98
|
//#endregion
|
|
99
99
|
export { trayHiddenMarker as a, launchTray as i, hasDesktop as n, isTrayHidden as r, cmdTray as t };
|
|
100
|
-
//# sourceMappingURL=trayApp-
|
|
100
|
+
//# sourceMappingURL=trayApp-BfUc_4-h.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __esmMin, r as __exportAll } from "./chunk-cZBX9HZv.js";
|
|
2
2
|
import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import { i as getInstalledPackage } from "./versionChecker-
|
|
3
|
+
import { i as getInstalledPackage } from "./versionChecker-CqLkSVM1.js";
|
|
4
4
|
import { t as agentYesHome } from "./agentYesHome-BNtn19J4.js";
|
|
5
5
|
import { u as removeControlCharacters } from "./todoAutomation-CbVVS4re.js";
|
|
6
6
|
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-BOIPD_Vs.js";
|
|
@@ -2086,7 +2086,7 @@ async function agentYes({ cli, cliArgs = [], skipPermissions = false, prompt, ro
|
|
|
2086
2086
|
}, 100);
|
|
2087
2087
|
const cleanupHeartbeat = () => clearInterval(heartbeatInterval);
|
|
2088
2088
|
shell.onExit(cleanupHeartbeat);
|
|
2089
|
-
const { startParentPingLoop } = await import("./parentPingLoop-
|
|
2089
|
+
const { startParentPingLoop } = await import("./parentPingLoop-BRhzqYJ-.js");
|
|
2090
2090
|
const parentPingLoop = startParentPingLoop({
|
|
2091
2091
|
parentPid,
|
|
2092
2092
|
selfWrapperPid: process.pid,
|
|
@@ -2349,4 +2349,4 @@ function sleep(ms) {
|
|
|
2349
2349
|
|
|
2350
2350
|
//#endregion
|
|
2351
2351
|
export { hasTodoStore as a, permissionBadge as c, answerAsk as i, AgentContext as l, agentYes as n, listAsks as o, config as r, listAsksForProject as s, CLIS_CONFIG as t, CLAUDE_SESSION_PIN_ENV as u };
|
|
2352
|
-
//# sourceMappingURL=ts
|
|
2352
|
+
//# sourceMappingURL=ts-CPqeQSS8.js.map
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
|
|
|
7
7
|
|
|
8
8
|
//#region package.json
|
|
9
9
|
var name = "agent-yes";
|
|
10
|
-
var version = "1.
|
|
10
|
+
var version = "1.293.0";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ts/versionChecker.ts
|
|
@@ -285,4 +285,4 @@ async function displayVersion() {
|
|
|
285
285
|
|
|
286
286
|
//#endregion
|
|
287
287
|
export { versionString as a, getInstalledPackage as i, compareVersions as n, displayVersion as r, checkAndAutoUpdate as t };
|
|
288
|
-
//# sourceMappingURL=versionChecker-
|
|
288
|
+
//# sourceMappingURL=versionChecker-CqLkSVM1.js.map
|
|
@@ -28,7 +28,7 @@ function parseFlags(args, known) {
|
|
|
28
28
|
}
|
|
29
29
|
/** Resolve the local daemon base URL + token (flags override discovery). */
|
|
30
30
|
async function daemonTarget(flags) {
|
|
31
|
-
const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-
|
|
31
|
+
const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-CplhD9SY.js");
|
|
32
32
|
const base = typeof flags.base === "string" ? flags.base : await resolveDaemonHttpBase();
|
|
33
33
|
if (!base) throw new Error("no running ay serve daemon found — start `ay serve` or pass --base <url> (e.g. http://127.0.0.1:PORT)");
|
|
34
34
|
const token = typeof flags.token === "string" ? flags.token : await loadTokenReadOnly() ?? "";
|
|
@@ -186,7 +186,7 @@ async function cmdMint(args) {
|
|
|
186
186
|
const bad = caps.filter((c) => !KNOWN_CAPS.has(c));
|
|
187
187
|
if (bad.length) throw new Error(`unknown cap(s): ${bad.join(", ")} (valid: ${[...KNOWN_CAPS].join(", ")})`);
|
|
188
188
|
const ttlSec = parseTtlSec(typeof flags.ttl === "string" ? flags.ttl : "15m");
|
|
189
|
-
const { mintScopedTermToken } = await import("./serve-
|
|
189
|
+
const { mintScopedTermToken } = await import("./serve-CplhD9SY.js");
|
|
190
190
|
const r = await mintScopedTermToken(target, {
|
|
191
191
|
ttlSec,
|
|
192
192
|
caps
|
|
@@ -202,4 +202,4 @@ async function cmdMint(args) {
|
|
|
202
202
|
|
|
203
203
|
//#endregion
|
|
204
204
|
export { cmdMint, cmdWidget };
|
|
205
|
-
//# sourceMappingURL=widget-
|
|
205
|
+
//# sourceMappingURL=widget-DTq1SAWM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as listRecords } from "./subcommands-
|
|
1
|
+
import { F as listRecords } from "./subcommands-CZZ-l7le.js";
|
|
2
2
|
import { a as getProvisionRoot } from "./workspaceConfig-DTvPtr5j.js";
|
|
3
3
|
import { existsSync } from "fs";
|
|
4
4
|
import { lstat, opendir } from "fs/promises";
|
|
@@ -424,4 +424,4 @@ async function cmdWs(args) {
|
|
|
424
424
|
|
|
425
425
|
//#endregion
|
|
426
426
|
export { isPathInside as a, walkWorkspaces as c, importProvisionModule as i, workspaceStatus as l, cmdWs as n, loadProvision as o, collectWorkspaces as r, resolveOperand as s, WS_JSON_SCHEMA as t };
|
|
427
|
-
//# sourceMappingURL=ws-
|
|
427
|
+
//# sourceMappingURL=ws-BxmJb-CE.js.map
|
|
@@ -5,10 +5,10 @@ import "./pidStore-DXWqzTSz.js";
|
|
|
5
5
|
import "./messageLog-Brx3w6zT.js";
|
|
6
6
|
import "./e2e-z1xpwSAg.js";
|
|
7
7
|
import "./configShared-DKTgiz7K.js";
|
|
8
|
-
import "./subcommands-
|
|
8
|
+
import "./subcommands-CZZ-l7le.js";
|
|
9
9
|
import "./notifyStore-2SWKGwZI.js";
|
|
10
10
|
import "./webrtcLink-CnQf9pmu.js";
|
|
11
|
-
import "./remotes-
|
|
12
|
-
import { a as isPathInside, c as walkWorkspaces, i as importProvisionModule, l as workspaceStatus, n as cmdWs, o as loadProvision, r as collectWorkspaces, s as resolveOperand, t as WS_JSON_SCHEMA } from "./ws-
|
|
11
|
+
import "./remotes-5P__pAXA.js";
|
|
12
|
+
import { a as isPathInside, c as walkWorkspaces, i as importProvisionModule, l as workspaceStatus, n as cmdWs, o as loadProvision, r as collectWorkspaces, s as resolveOperand, t as WS_JSON_SCHEMA } from "./ws-BxmJb-CE.js";
|
|
13
13
|
|
|
14
14
|
export { WS_JSON_SCHEMA, cmdWs, collectWorkspaces, isPathInside, loadProvision, walkWorkspaces, workspaceStatus };
|
package/package.json
CHANGED
package/ts/rustBinary.ts
CHANGED
|
@@ -234,6 +234,28 @@ export function findTrayLauncher(): string | undefined {
|
|
|
234
234
|
return undefined;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Locate the `ayrs` binary (the Rust `serve` daemon). Same install shapes as
|
|
239
|
+
* the agent runtime — a dev `rs/target` build, the downloaded release bin dir
|
|
240
|
+
* (CI ships ayrs in every platform bundle since #473), or `~/.cargo/bin` on
|
|
241
|
+
* PATH after `bun run build:rs`. Undefined when absent (an older release, or a
|
|
242
|
+
* platform whose bundle predates it) — callers fall back to the TS server.
|
|
243
|
+
*/
|
|
244
|
+
export function findAyrsBinary(): string | undefined {
|
|
245
|
+
const exe = process.platform === "win32" ? "ayrs.exe" : "ayrs";
|
|
246
|
+
const dir = import.meta.dirname ?? import.meta.dir;
|
|
247
|
+
const searchPaths = [
|
|
248
|
+
path.resolve(dir, `../rs/target/release/${exe}`),
|
|
249
|
+
path.resolve(dir, `../rs/target/debug/${exe}`),
|
|
250
|
+
path.join(getBinDir(), exe),
|
|
251
|
+
Bun.which("ayrs") ?? "",
|
|
252
|
+
];
|
|
253
|
+
for (const p of searchPaths) {
|
|
254
|
+
if (p && existsSync(p)) return p;
|
|
255
|
+
}
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
|
|
237
259
|
/**
|
|
238
260
|
* Get GitHub release download URL for the binary
|
|
239
261
|
*/
|
package/ts/serve.ts
CHANGED
|
@@ -1648,6 +1648,34 @@ async function cmdServeStatus(args: string[]): Promise<number> {
|
|
|
1648
1648
|
// ay serve
|
|
1649
1649
|
// ---------------------------------------------------------------------------
|
|
1650
1650
|
|
|
1651
|
+
// Run `ayrs serve …` in the foreground with our stdio, forwarding the signals a
|
|
1652
|
+
// terminal sends us so Ctrl-C reaches the daemon (which closes its room peers)
|
|
1653
|
+
// and the manager's SIGTERM on `stop` isn't swallowed by the launcher.
|
|
1654
|
+
async function runAyrsServe(ayrs: string, argv: string[]): Promise<number> {
|
|
1655
|
+
const child = Bun.spawn([ayrs, ...argv], {
|
|
1656
|
+
stdio: ["inherit", "inherit", "inherit"],
|
|
1657
|
+
env: process.env,
|
|
1658
|
+
cwd: process.cwd(),
|
|
1659
|
+
});
|
|
1660
|
+
const forward = (sig: NodeJS.Signals) => () => {
|
|
1661
|
+
try {
|
|
1662
|
+
child.kill(sig);
|
|
1663
|
+
} catch {
|
|
1664
|
+
/* already gone */
|
|
1665
|
+
}
|
|
1666
|
+
};
|
|
1667
|
+
const onInt = forward("SIGINT");
|
|
1668
|
+
const onTerm = forward("SIGTERM");
|
|
1669
|
+
process.on("SIGINT", onInt);
|
|
1670
|
+
process.on("SIGTERM", onTerm);
|
|
1671
|
+
try {
|
|
1672
|
+
return await child.exited;
|
|
1673
|
+
} finally {
|
|
1674
|
+
process.off("SIGINT", onInt);
|
|
1675
|
+
process.off("SIGTERM", onTerm);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1651
1679
|
export async function cmdServe(rest: string[]): Promise<number> {
|
|
1652
1680
|
if (rest.includes("-h") || rest.includes("--help")) {
|
|
1653
1681
|
process.stdout.write(
|
|
@@ -1663,6 +1691,10 @@ export async function cmdServe(rest: string[]): Promise<number> {
|
|
|
1663
1691
|
` The minted room persists in ~/.agent-yes/.share-room\n` +
|
|
1664
1692
|
` (stable link across restarts; delete the file to rotate).\n` +
|
|
1665
1693
|
` --share [URL] Legacy alias for --http --webrtc\n\n` +
|
|
1694
|
+
`Runtime: like \`ay <cli>\`, the Rust daemon (ayrs serve) runs by default for\n` +
|
|
1695
|
+
` the flags it supports — --webrtc [webrtc://url], --port N, --sighost H.\n` +
|
|
1696
|
+
` Everything else (bare \`ay serve\`, --share/--http/--host/--tls-*, the\n` +
|
|
1697
|
+
` subcommands) runs the TypeScript server. --no-rust forces TypeScript.\n\n` +
|
|
1666
1698
|
`Options:\n` +
|
|
1667
1699
|
` --port N Bypass Portless and listen on a fixed HTTP port\n` +
|
|
1668
1700
|
` --host HOST Interface to bind (default: 127.0.0.1; use 0.0.0.0 to expose)\n` +
|
|
@@ -1686,6 +1718,25 @@ export async function cmdServe(rest: string[]): Promise<number> {
|
|
|
1686
1718
|
return 0;
|
|
1687
1719
|
}
|
|
1688
1720
|
|
|
1721
|
+
// Rust first, like `ay <cli>`: an invocation `ayrs serve` can express runs
|
|
1722
|
+
// the Rust daemon; the rest stays here. See ts/serveRust.ts for the split.
|
|
1723
|
+
// `--no-rust` is stripped for the parsers below either way.
|
|
1724
|
+
{
|
|
1725
|
+
const { planRustServe } = await import("./serveRust.ts");
|
|
1726
|
+
const plan = planRustServe(rest);
|
|
1727
|
+
if (plan.kind === "rust") {
|
|
1728
|
+
const { findAyrsBinary } = await import("./rustBinary.ts");
|
|
1729
|
+
const ayrs = findAyrsBinary();
|
|
1730
|
+
if (ayrs) return runAyrsServe(ayrs, plan.argv);
|
|
1731
|
+
process.stderr.write(
|
|
1732
|
+
`ay serve: ayrs binary not found — running the TypeScript server ` +
|
|
1733
|
+
`(bun run build:rs, or reinstall, to get the Rust daemon)\n`,
|
|
1734
|
+
);
|
|
1735
|
+
} else {
|
|
1736
|
+
rest = plan.rest;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1689
1740
|
// Daemon subcommands
|
|
1690
1741
|
const sub = rest[0];
|
|
1691
1742
|
if (sub === "status") return cmdServeStatus(rest.slice(1));
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { planRustServe } from "./serveRust.ts";
|
|
3
|
+
|
|
4
|
+
// `ay serve` runs the Rust daemon (`ayrs serve`) by default, like `ay <cli>`
|
|
5
|
+
// runs the Rust agent runtime — but only for invocations ayrs can express.
|
|
6
|
+
// Everything else must stay on the TypeScript server WITH a reason, never a
|
|
7
|
+
// silent downgrade of the flags the operator passed.
|
|
8
|
+
describe("planRustServe", () => {
|
|
9
|
+
const env = {};
|
|
10
|
+
|
|
11
|
+
it("delegates the flags ayrs serve accepts, in both spellings", () => {
|
|
12
|
+
expect(planRustServe(["--webrtc"], env)).toEqual({ kind: "rust", argv: ["serve", "--webrtc"] });
|
|
13
|
+
expect(planRustServe(["--webrtc", "webrtc://r1:e1.ab@s.example"], env)).toEqual({
|
|
14
|
+
kind: "rust",
|
|
15
|
+
argv: ["serve", "--webrtc", "webrtc://r1:e1.ab@s.example"],
|
|
16
|
+
});
|
|
17
|
+
expect(planRustServe(["--webrtc=webrtc://r1:e1.ab@s.example", "--port=0"], env)).toEqual({
|
|
18
|
+
kind: "rust",
|
|
19
|
+
argv: ["serve", "--webrtc", "webrtc://r1:e1.ab@s.example", "--port", "0"],
|
|
20
|
+
});
|
|
21
|
+
expect(planRustServe(["--port", "4546", "--sighost", "s.example"], env)).toEqual({
|
|
22
|
+
kind: "rust",
|
|
23
|
+
argv: ["serve", "--port", "4546", "--sighost", "s.example"],
|
|
24
|
+
});
|
|
25
|
+
// A bare --webrtc followed by another flag does not swallow that flag.
|
|
26
|
+
expect(planRustServe(["--webrtc", "--port", "0"], env)).toEqual({
|
|
27
|
+
kind: "rust",
|
|
28
|
+
argv: ["serve", "--webrtc", "--port", "0"],
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("honours the explicit opt-outs and strips --no-rust for the TS parser", () => {
|
|
33
|
+
expect(planRustServe(["--webrtc", "--no-rust"], env)).toEqual({
|
|
34
|
+
kind: "ts",
|
|
35
|
+
reason: "--no-rust",
|
|
36
|
+
rest: ["--webrtc"],
|
|
37
|
+
});
|
|
38
|
+
expect(planRustServe(["--webrtc"], { AGENT_YES_NO_RUST: "1" })).toMatchObject({
|
|
39
|
+
kind: "ts",
|
|
40
|
+
reason: "AGENT_YES_NO_RUST=1",
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("keeps the bare `ay serve` (Portless console) on TypeScript", () => {
|
|
45
|
+
expect(planRustServe([], env)).toMatchObject({ kind: "ts", rest: [] });
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("never delegates the daemon subcommands — ayrs has its own supervisor", () => {
|
|
49
|
+
for (const sub of ["install", "uninstall", "status", "logs", "start", "stop", "healthcheck"]) {
|
|
50
|
+
expect(planRustServe([sub, "--webrtc"], env)).toMatchObject({
|
|
51
|
+
kind: "ts",
|
|
52
|
+
reason: `\`ay serve ${sub}\``,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("falls back, naming the flag, on anything ayrs cannot express", () => {
|
|
58
|
+
expect(planRustServe(["--share"], env)).toMatchObject({ kind: "ts", reason: "--share" });
|
|
59
|
+
expect(planRustServe(["--webrtc", "--http"], env)).toMatchObject({
|
|
60
|
+
kind: "ts",
|
|
61
|
+
reason: "--http",
|
|
62
|
+
});
|
|
63
|
+
expect(planRustServe(["-d", "--webrtc"], env)).toMatchObject({ kind: "ts", reason: "-d" });
|
|
64
|
+
expect(planRustServe(["--port", "0", "--host", "0.0.0.0"], env)).toMatchObject({
|
|
65
|
+
kind: "ts",
|
|
66
|
+
reason: "--host",
|
|
67
|
+
});
|
|
68
|
+
// ayrs pins a room by webrtc:// url only; an https room link stays on TS,
|
|
69
|
+
// which knows how to normalise it.
|
|
70
|
+
expect(
|
|
71
|
+
planRustServe(["--webrtc", "https://agent-yes.com/room/#room=r1&s=e1.ab"], env),
|
|
72
|
+
).toMatchObject({
|
|
73
|
+
kind: "ts",
|
|
74
|
+
reason: expect.stringContaining("webrtc:// urls only"),
|
|
75
|
+
});
|
|
76
|
+
expect(planRustServe(["--port", "abc"], env)).toMatchObject({
|
|
77
|
+
kind: "ts",
|
|
78
|
+
reason: "--port abc",
|
|
79
|
+
});
|
|
80
|
+
expect(planRustServe(["--port"], env)).toMatchObject({
|
|
81
|
+
kind: "ts",
|
|
82
|
+
reason: "--port (missing)",
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
package/ts/serveRust.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ay serve` → `ayrs serve` delegation.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors how `ay <cli>` runs the Rust agent runtime by default and only falls
|
|
5
|
+
* back to TypeScript on `--no-rust`: the Rust serve daemon (`ayrs`) becomes the
|
|
6
|
+
* default for every invocation it can express, and the TypeScript server keeps
|
|
7
|
+
* everything it can't (yet). The decision is a pure function of the argv so the
|
|
8
|
+
* contract is testable and the fallback reason is explicit — a silent fallback
|
|
9
|
+
* would leave an operator unsure which daemon they are looking at.
|
|
10
|
+
*
|
|
11
|
+
* What delegates today — exactly the flags `ayrs serve` accepts:
|
|
12
|
+
* --webrtc (bare: load/mint the persisted room)
|
|
13
|
+
* --webrtc <url> / --webrtc=<url> (a webrtc:// room url)
|
|
14
|
+
* --port <n> / --port=<n> (loopback HTTP console; 0 = free port)
|
|
15
|
+
* --sighost <host> / --sighost=<host>
|
|
16
|
+
*
|
|
17
|
+
* What stays on TypeScript, with the reason printed:
|
|
18
|
+
* - `--no-rust` / AGENT_YES_NO_RUST=1 (explicit opt-out)
|
|
19
|
+
* - the bare `ay serve` (Portless HTTPS on agent-yes.localhost has no ayrs
|
|
20
|
+
* equivalent — `--port` is a plain loopback listener)
|
|
21
|
+
* - the daemon subcommands (install/uninstall/status/logs/start/stop/
|
|
22
|
+
* healthcheck) and -d/--daemon: ayrs has its own OS-supervisor install and
|
|
23
|
+
* the two must not manage each other's registration
|
|
24
|
+
* - --share (http+webrtc over Portless), --http, --host, --token, --tls-*,
|
|
25
|
+
* --local, https room links (ayrs pins rooms by webrtc:// url only)
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** Subcommands `ay serve` dispatches before flag parsing — never delegated. */
|
|
29
|
+
const SERVE_SUBCOMMANDS = new Set([
|
|
30
|
+
"install",
|
|
31
|
+
"uninstall",
|
|
32
|
+
"status",
|
|
33
|
+
"logs",
|
|
34
|
+
"start",
|
|
35
|
+
"stop",
|
|
36
|
+
"healthcheck",
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
export type RustServePlan =
|
|
40
|
+
| { kind: "rust"; argv: string[] }
|
|
41
|
+
| { kind: "ts"; reason: string; rest: string[] };
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Decide whether `rest` (the argv after `serve`) can run as `ayrs serve`.
|
|
45
|
+
* Returns the ayrs argv (without the program) or the TS fallback with its
|
|
46
|
+
* reason and the argv the TS path should parse (`--no-rust` stripped).
|
|
47
|
+
*/
|
|
48
|
+
export function planRustServe(
|
|
49
|
+
rest: string[],
|
|
50
|
+
env: Record<string, string | undefined> = process.env,
|
|
51
|
+
): RustServePlan {
|
|
52
|
+
const stripped = rest.filter((a) => a !== "--no-rust");
|
|
53
|
+
if (stripped.length !== rest.length) {
|
|
54
|
+
return { kind: "ts", reason: "--no-rust", rest: stripped };
|
|
55
|
+
}
|
|
56
|
+
if (env.AGENT_YES_NO_RUST === "1") {
|
|
57
|
+
return { kind: "ts", reason: "AGENT_YES_NO_RUST=1", rest };
|
|
58
|
+
}
|
|
59
|
+
if (rest.length === 0) {
|
|
60
|
+
return { kind: "ts", reason: "bare `ay serve` (Portless HTTPS console)", rest };
|
|
61
|
+
}
|
|
62
|
+
const first = rest[0]!;
|
|
63
|
+
if (SERVE_SUBCOMMANDS.has(first)) {
|
|
64
|
+
return { kind: "ts", reason: `\`ay serve ${first}\``, rest };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const argv = ["serve"];
|
|
68
|
+
for (let i = 0; i < rest.length; i++) {
|
|
69
|
+
const a = rest[i]!;
|
|
70
|
+
const eq = a.indexOf("=");
|
|
71
|
+
const name = eq === -1 ? a : a.slice(0, eq);
|
|
72
|
+
const inline = eq === -1 ? undefined : a.slice(eq + 1);
|
|
73
|
+
// A following token is this flag's value unless it looks like another flag.
|
|
74
|
+
const next = rest[i + 1];
|
|
75
|
+
const takeNext = () => {
|
|
76
|
+
if (inline !== undefined) return inline;
|
|
77
|
+
if (next !== undefined && !next.startsWith("-")) {
|
|
78
|
+
i++;
|
|
79
|
+
return next;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
};
|
|
83
|
+
switch (name) {
|
|
84
|
+
case "--webrtc": {
|
|
85
|
+
const v = takeNext();
|
|
86
|
+
if (v === undefined) {
|
|
87
|
+
argv.push("--webrtc");
|
|
88
|
+
} else if (v.startsWith("webrtc://")) {
|
|
89
|
+
argv.push("--webrtc", v);
|
|
90
|
+
} else {
|
|
91
|
+
return { kind: "ts", reason: `--webrtc ${v} (ayrs takes webrtc:// urls only)`, rest };
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case "--port": {
|
|
96
|
+
const v = takeNext();
|
|
97
|
+
if (v === undefined || !/^\d+$/.test(v)) {
|
|
98
|
+
return { kind: "ts", reason: `--port ${v ?? "(missing)"}`, rest };
|
|
99
|
+
}
|
|
100
|
+
argv.push("--port", v);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case "--sighost": {
|
|
104
|
+
const v = takeNext();
|
|
105
|
+
if (v === undefined) return { kind: "ts", reason: "--sighost (missing value)", rest };
|
|
106
|
+
argv.push("--sighost", v);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
default:
|
|
110
|
+
return { kind: "ts", reason: a, rest };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return { kind: "rust", argv };
|
|
114
|
+
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import "./versionChecker-CLOLbs5d.js";
|
|
2
|
-
import { a as findTrayLauncher, c as getBinaryName, i as findSpawnHiddenLauncher, l as getDownloadUrl, n as downloadBinary, o as gcOldBinaryDirs, r as findRustBinary, s as getBinDir, t as devBuildInfo, u as getRustBinary } from "./rustBinary-CK3xoBVr.js";
|
|
3
|
-
|
|
4
|
-
export { gcOldBinaryDirs };
|
package/dist/trayApp-oPSkAWLK.js
DELETED