@conveno/cli 0.2.0-rc.14 → 0.2.0-rc.15
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 +1 -1
- package/dist/{acp-OHqthTVC.js → acp-DZf0zyNC.js} +3 -3
- package/dist/{agy-relay-DLP2H1Rj.js → agy-relay-DSRJtMz3.js} +3 -2
- package/dist/{args-DmUsbNu9.js → args-CpAvszNY.js} +5 -4
- package/dist/bin.js +2 -2
- package/dist/daemon.js +17 -8
- package/dist/{daemonError-CUE_dVn-.js → daemonError-Bj22X-4V.js} +1 -1
- package/dist/{dist-vefQHFb-.js → dist-Bv1bmmme.js} +1 -1
- package/dist/{dist-C4Ey9THP.js → dist-Bx22a5AV.js} +1 -1
- package/dist/{dist-D-PhGsuL.js → dist-C4KljaIP.js} +1 -1
- package/dist/{dist-BYkDv29h.js → dist-C59LTq60.js} +1 -1
- package/dist/{dist-Cv5et1iE.js → dist-DDzIkwf9.js} +1 -1
- package/dist/{dist-1k5b8UGF.js → dist-ZL7d4_97.js} +6 -3
- package/dist/{dist-BiV6HopA.js → dist-fI_XSoCQ.js} +56 -11
- package/dist/{hook-mvifUk0K.js → hook-BFZTvd7M.js} +1 -1
- package/dist/hook-entry-CmuvppGf.js +1 -0
- package/dist/{hook-entry-Cxh3yIdT.js → hook-entry-CvzyjOo4.js} +6 -6
- package/dist/{main-BY7Kcf9S.js → main-1QSm5UjR.js} +12 -15
- package/dist/{pick-ClIK4l8K.js → pick-DaCRjuyz.js} +1 -1
- package/dist/{run-BYmOjvDF.js → run-CKiYjNqx.js} +5 -6
- package/dist/{runtime-PeEPWwix.js → runtime-CeFKWoIL.js} +10 -10
- package/dist/{uninstall-CQoGVhp3.js → uninstall-DK25hyWX.js} +7 -7
- package/dist/{watch-CaC2G2cT.js → watch-De3wbdQL.js} +4 -4
- package/package.json +13 -13
- package/dist/hook-entry-De06GWme.js +0 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Or run `conveno` with no arguments. It opens a full-screen app (Sessions, New, D
|
|
|
39
39
|
| `conveno send <to> <text...> [--urgent]` | Send a message as you to a session name or id, `lead`, or `device:name`. `-` reads the text from standard input. |
|
|
40
40
|
| `conveno rename <session> <new-name>` | Rename an online session. |
|
|
41
41
|
| `conveno lead <session>` | Make a session the lead. `conveno lead --clear` leaves no lead. |
|
|
42
|
-
| `conveno spawn <cli> [--cwd <dir>] [--name <name>] [--task <text> \| --task-file <path>] [--window] [--access <read\|edit\|full>] [--yes]` | Start a worker session of `claude`, `codex`, `opencode`, `antigravity` or `grok`, and print its name once it registers. The CLI must be installed. By default the worker runs in the background through the CLI's Agent Client Protocol server, with `conveno acp-host` driving it. It keeps running: each message sent to it becomes its next prompt at once when it is idle, or when its current turn ends. `--window` opens the real CLI in a new terminal instead, so you can watch it and take over: Windows Terminal (`wt -w 0 new-tab`, else a new console window) on Windows, Terminal.app (iTerm2 when it is your terminal) on macOS, and on Linux a new tmux window when you are inside tmux, else the first of `x-terminal-emulator`, `gnome-terminal`, `konsole`, `kitty`, `wezterm`, `alacritty` and `xterm`. The ACP commands are `claude-agent-acp` (install `@agentclientprotocol/claude-agent-acp`), `codex-acp` (install `@agentclientprotocol/codex-acp`), `opencode acp`, `agy acp` and `grok agent stdio`; a missing one is an error that says what to install. For Claude Code and Codex, `conveno init` can allow running the adapter with `npx -y <package>@<pinned version>`, and `CONVENO_ACP_CODEX_CMD` / `CONVENO_ACP_CLAUDE_CMD` replace the command. In the background a tool call the `--access` preset (`read`, `edit` or `full`; default `
|
|
42
|
+
| `conveno spawn <cli> [--cwd <dir>] [--name <name>] [--task <text> \| --task-file <path>] [--window] [--access <read\|edit\|full>] [--yes]` | Start a worker session of `claude`, `codex`, `opencode`, `antigravity` or `grok`, and print its name once it registers. The CLI must be installed. By default the worker runs in the background through the CLI's Agent Client Protocol server, with `conveno acp-host` driving it. It keeps running: each message sent to it becomes its next prompt at once when it is idle, or when its current turn ends. `--window` opens the real CLI in a new terminal instead, so you can watch it and take over: Windows Terminal (`wt -w 0 new-tab`, else a new console window) on Windows, Terminal.app (iTerm2 when it is your terminal) on macOS, and on Linux a new tmux window when you are inside tmux, else the first of `x-terminal-emulator`, `gnome-terminal`, `konsole`, `kitty`, `wezterm`, `alacritty` and `xterm`. The ACP commands are `claude-agent-acp` (install `@agentclientprotocol/claude-agent-acp`), `codex-acp` (install `@agentclientprotocol/codex-acp`), `opencode acp`, `agy acp` and `grok agent stdio`; a missing one is an error that says what to install. For Claude Code and Codex, `conveno init` can allow running the adapter with `npx -y <package>@<pinned version>`, and `CONVENO_ACP_CODEX_CMD` / `CONVENO_ACP_CLAUDE_CMD` replace the command. In the background a tool call the `--access` preset (`read`, `edit` or `full`; default `full`) does not cover is asked of the session that spawned the worker. The first task is optional. `--name` sets the session name (a taken or reserved one is refused); otherwise the usual `<cli>@<repo>-<n>` name is used. `--cwd` defaults to the current folder, which must be inside your home folder; an explicit `--cwd` can be anywhere. It asks first and `--yes` skips the question; without a terminal it exits 2 unless `--yes` is given. At most 8 spawned sessions run at once (`CONVENO_SPAWN_MAX` changes that), and a spawned session cannot spawn more than 3 levels deep. A task is at most 16000 characters. See `packages/protocol/PROTOCOL.md`. |
|
|
43
43
|
| `conveno stop <worker>` | Stop a background worker. It cancels a running turn, ends its CLI and the processes it started, tells the spawning session why, and goes offline. A worker in a window is yours to close. |
|
|
44
44
|
| `conveno doctor [--cli <list>]` | Check each CLI and the daemon, and say how to fix what is wrong. `--cli claude,codex` checks only those CLIs, so problems in the others do not count. |
|
|
45
45
|
| `conveno devices [pair\|join\|revoke\|rename\|accept\|reset]` | Pro. List your devices, or pair a new machine: `pair` on one device and `join` on the new one at the same time, then type the 8-digit code each screen shows. `revoke` removes a device for good. Needs a Pro login on both. |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writeFileSync } from "node:fs";
|
|
2
|
-
import { n as runAcpHostFromFile, r as stopRequestPath, t as killProcessTree } from "./dist-
|
|
3
|
-
import { Kt as readSpawnRecord, an as spawnRecordPath } from "./dist-
|
|
4
|
-
import { a as parseFlags, n as COMMANDS } from "./args-
|
|
2
|
+
import { n as runAcpHostFromFile, r as stopRequestPath, t as killProcessTree } from "./dist-fI_XSoCQ.js";
|
|
3
|
+
import { Kt as readSpawnRecord, an as spawnRecordPath } from "./dist-ZL7d4_97.js";
|
|
4
|
+
import { a as parseFlags, n as COMMANDS } from "./args-CpAvszNY.js";
|
|
5
5
|
import { a as fail, n as cmd } from "./fmt-C2SsP5Y0.js";
|
|
6
6
|
// src/acp.ts
|
|
7
7
|
/** How long `conveno stop` waits for a worker to end by itself before it ends the process tree. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
|
-
import { t as RELAY_SUBCOMMAND } from "./dist-
|
|
3
|
-
import { nn as runWaker } from "./dist-
|
|
2
|
+
import { t as RELAY_SUBCOMMAND } from "./dist-Bv1bmmme.js";
|
|
3
|
+
import { nn as runWaker } from "./dist-ZL7d4_97.js";
|
|
4
4
|
import { n as connectOpts } from "./ctx-tYftvhz_.js";
|
|
5
5
|
// src/agy-relay.ts
|
|
6
6
|
/**
|
|
@@ -64,6 +64,7 @@ async function runAgyRelay(ctx, argv, deps = {}) {
|
|
|
64
64
|
ctx.out(`[conveno] ${RELAY_SUBCOMMAND} ended: ${why}\n`);
|
|
65
65
|
return code;
|
|
66
66
|
};
|
|
67
|
+
if (ctx.env.CONVENO_ACP_WORKER === "1") return 0;
|
|
67
68
|
if (argv.length > 0) return end("it takes no arguments.", 2);
|
|
68
69
|
const conversationId = ctx.env.ANTIGRAVITY_CONVERSATION_ID;
|
|
69
70
|
const exe = ctx.env.ANTIGRAVITY_AGENTAPI_EXE;
|
|
@@ -45,7 +45,7 @@ const COMMANDS = [
|
|
|
45
45
|
"worker-access": {
|
|
46
46
|
type: "string",
|
|
47
47
|
value: "<read|edit|full>",
|
|
48
|
-
help: "What background workers may do: read, edit (the default)
|
|
48
|
+
help: "What background workers may do: read, edit or full (the default)"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
notes: [
|
|
@@ -161,7 +161,7 @@ const COMMANDS = [
|
|
|
161
161
|
access: {
|
|
162
162
|
type: "string",
|
|
163
163
|
value: "<read|edit|full>",
|
|
164
|
-
help: "Background: what the worker may do without asking (default:
|
|
164
|
+
help: "Background: what the worker may do without asking (default: your setting, full unless changed)"
|
|
165
165
|
},
|
|
166
166
|
yes: {
|
|
167
167
|
type: "boolean",
|
|
@@ -171,11 +171,12 @@ const COMMANDS = [
|
|
|
171
171
|
},
|
|
172
172
|
notes: [
|
|
173
173
|
"--access sets what a background worker may do without asking: read (look only), edit (also",
|
|
174
|
-
"change files and fetch pages
|
|
174
|
+
"change files and fetch pages) or full (everything). Without it, your setting applies; full unless changed.",
|
|
175
175
|
"By default the worker runs in the background over ACP and stays alive. Each message sent to",
|
|
176
176
|
"it becomes its next prompt: right away when it is idle, else when its turn ends.",
|
|
177
177
|
"--window opens the real CLI in a new terminal instead, so you can watch it and take over.",
|
|
178
|
-
"In the background, tool calls the preset does not cover are
|
|
178
|
+
"In the background, tool calls the preset does not cover are asked of the session that spawned the worker,",
|
|
179
|
+
"and denied if nobody answers in time or there is nobody to ask.",
|
|
179
180
|
"Conveno's own tools, such as send, are always allowed.",
|
|
180
181
|
"claude and codex need an ACP adapter installed. End a worker with conveno stop.",
|
|
181
182
|
"Waits until the session registers, then prints its name.",
|
package/dist/bin.js
CHANGED
|
@@ -40,9 +40,9 @@ for (const stream of [process.stdout, process.stderr]) stream.on("error", (err)
|
|
|
40
40
|
});
|
|
41
41
|
try {
|
|
42
42
|
let code;
|
|
43
|
-
if (isHook) code = await (await import("./hook-entry-
|
|
43
|
+
if (isHook) code = await (await import("./hook-entry-CmuvppGf.js")).runHookEntry(argv.slice(1));
|
|
44
44
|
else {
|
|
45
|
-
const [{ main }, { createRuntimeCtx }] = await Promise.all([import("./main-
|
|
45
|
+
const [{ main }, { createRuntimeCtx }] = await Promise.all([import("./main-1QSm5UjR.js"), import("./runtime-CeFKWoIL.js")]);
|
|
46
46
|
code = await main(argv, createRuntimeCtx());
|
|
47
47
|
}
|
|
48
48
|
if (isHook) process.exit(code);
|
package/dist/daemon.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { homedir, hostname, userInfo } from "node:os";
|
|
3
|
-
import { t as codexAdapter } from "./dist-
|
|
4
|
-
import { $ as formatContinuation, $n as sanitizeLine, $t as resolveRecipient, A as claimOrchestrator, B as dataDir, Bn as defaultSocketPath, Bt as readAccountTokens, Ct as oneWindowPerHost, D as autoLimitsFromEnv, E as autoCandidates, En as EVENT_NAMES, Gn as makeEventNotification, Gt as readSettings, H as decideAutoContinue, In as SESSION_ENDED_TEXT, It as planSpawn, Jn as newMessageId, Kn as makeResult, L as createWmiWalker, M as clearOrchestrator, Mn as PROTOCOL_VERSION, N as clientProof, Nn as RelayPayload, O as baseName, Pn as RpcErrorCode, Qn as safeParse, R as currentAccessToken, Rn as SessionId, Rt as proofsMatch, S as appendHookLog, St as newAuthNonce, Tn as DeviceId, U as defaultProcessIo, Un as isSocketPathTooLong, Ut as readInbox, V as dataPaths, Vn as encodeFrame, Vt as readAncestry, W as detectRepo, Wn as makeError, Xn as parseIpcRequest, Xt as requeueEntries, Y as evaluateLiveness, Yn as newSessionId, Zn as parseRelayFrame, _ as ackEntries, _t as leadLogPath, bt as markDelivered, cn as statusAfterLiveness, dn as takeWithinChars, dt as isOnline, er as socketPathTooLongMessage, et as formatHookContext, fn as tooManyUnreadMessage, ft as jwtClaim, gn as validateRename, gt as leadLogLine, i as ConvenoError, jn as OWNER_SESSION_ID, k as bindAccountDevice, kn as Message, kt as pendingForInjection, l as RESPONSE_BUDGET_BYTES, n as AccountError, nt as generateSessionName, pn as turnHops, q as effectiveHolder, qn as newDeviceId, rt as holderAfterDeparture, un as takeWithinBytes, z as daemonProof, zn as createLineDecoder } from "./dist-
|
|
3
|
+
import { t as codexAdapter } from "./dist-DDzIkwf9.js";
|
|
4
|
+
import { $ as formatContinuation, $n as sanitizeLine, $t as resolveRecipient, A as claimOrchestrator, B as dataDir, Bn as defaultSocketPath, Bt as readAccountTokens, Ct as oneWindowPerHost, D as autoLimitsFromEnv, E as autoCandidates, En as EVENT_NAMES, Gn as makeEventNotification, Gt as readSettings, H as decideAutoContinue, In as SESSION_ENDED_TEXT, It as planSpawn, Jn as newMessageId, Kn as makeResult, L as createWmiWalker, M as clearOrchestrator, Mn as PROTOCOL_VERSION, N as clientProof, Nn as RelayPayload, O as baseName, Pn as RpcErrorCode, Qn as safeParse, R as currentAccessToken, Rn as SessionId, Rt as proofsMatch, S as appendHookLog, St as newAuthNonce, Tn as DeviceId, U as defaultProcessIo, Un as isSocketPathTooLong, Ut as readInbox, V as dataPaths, Vn as encodeFrame, Vt as readAncestry, W as detectRepo, Wn as makeError, Xn as parseIpcRequest, Xt as requeueEntries, Y as evaluateLiveness, Yn as newSessionId, Zn as parseRelayFrame, _ as ackEntries, _t as leadLogPath, bt as markDelivered, cn as statusAfterLiveness, dn as takeWithinChars, dt as isOnline, er as socketPathTooLongMessage, et as formatHookContext, fn as tooManyUnreadMessage, ft as jwtClaim, gn as validateRename, gt as leadLogLine, i as ConvenoError, jn as OWNER_SESSION_ID, k as bindAccountDevice, kn as Message, kt as pendingForInjection, l as RESPONSE_BUDGET_BYTES, n as AccountError, nt as generateSessionName, pn as turnHops, q as effectiveHolder, qn as newDeviceId, rt as holderAfterDeparture, un as takeWithinBytes, z as daemonProof, zn as createLineDecoder } from "./dist-ZL7d4_97.js";
|
|
5
5
|
import { randomBytes } from "node:crypto";
|
|
6
6
|
import { appendFileSync, chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { connect, createServer } from "node:net";
|
|
8
8
|
import { dirname, join, posix, win32 } from "node:path";
|
|
9
|
-
import { _ as sasMatches, a as JoinerPairing, b as signRelayHello, c as decodePairMessage, d as forkPoint, f as generateIdentity, g as publicRecord, h as parseIdentity, i as InviterPairing, l as deviceFingerprint, m as openEnvelope, n as ENVELOPE_MAX_AGE_MS, o as appendRevoke, p as headMatches, r as ENVELOPE_MAX_FUTURE_MS, s as chainHead, t as CryptoError, u as encodePairMessage, v as sealEnvelope, x as verifyChain, y as serializeIdentity } from "./dist-
|
|
9
|
+
import { _ as sasMatches, a as JoinerPairing, b as signRelayHello, c as decodePairMessage, d as forkPoint, f as generateIdentity, g as publicRecord, h as parseIdentity, i as InviterPairing, l as deviceFingerprint, m as openEnvelope, n as ENVELOPE_MAX_AGE_MS, o as appendRevoke, p as headMatches, r as ENVELOPE_MAX_FUTURE_MS, s as chainHead, t as CryptoError, u as encodePairMessage, v as sealEnvelope, x as verifyChain, y as serializeIdentity } from "./dist-Bx22a5AV.js";
|
|
10
10
|
import { execFileSync } from "node:child_process";
|
|
11
11
|
import { DatabaseSync } from "node:sqlite";
|
|
12
12
|
// ../daemon/src/lifecycle.ts
|
|
@@ -1970,7 +1970,7 @@ var Store = class {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
};
|
|
1972
1972
|
// ../daemon/src/server.ts
|
|
1973
|
-
const DAEMON_VERSION = "0.2.0-rc.
|
|
1973
|
+
const DAEMON_VERSION = "0.2.0-rc.15";
|
|
1974
1974
|
/** A connection that has not finished the handshake by then is closed. */
|
|
1975
1975
|
const AUTH_TIMEOUT_MS = 5e3;
|
|
1976
1976
|
/** Unread messages one session may hold. */
|
|
@@ -2046,6 +2046,8 @@ var Daemon = class {
|
|
|
2046
2046
|
idleSince;
|
|
2047
2047
|
startedMs;
|
|
2048
2048
|
/** Permission requests of workers that wait for their spawner, by request id. In memory only. */
|
|
2049
|
+
/** When each session last sent a message (since this daemon started). */
|
|
2050
|
+
lastSent = /* @__PURE__ */ new Map();
|
|
2049
2051
|
asks = /* @__PURE__ */ new Map();
|
|
2050
2052
|
/** When each session went offline, for the removal grace. In memory only. */
|
|
2051
2053
|
offlineSince = /* @__PURE__ */ new Map();
|
|
@@ -2137,6 +2139,10 @@ var Daemon = class {
|
|
|
2137
2139
|
this.send(conn, makeError(req.id, RpcErrorCode.Unauthorized, unauthorizedMessage));
|
|
2138
2140
|
return;
|
|
2139
2141
|
}
|
|
2142
|
+
if (req.method === "permission.ask") {
|
|
2143
|
+
(async () => this.dispatch(conn, req))().then((result) => this.send(conn, makeResult(req.id, result)), (e) => this.sendError(conn, req.id, req.method, e));
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2140
2146
|
try {
|
|
2141
2147
|
const result = await this.dispatch(conn, req);
|
|
2142
2148
|
const flushed = req.method === "daemon.shutdown" ? this.requestShutdown : void 0;
|
|
@@ -2241,7 +2247,8 @@ var Daemon = class {
|
|
|
2241
2247
|
...row,
|
|
2242
2248
|
deliveryTier: tier
|
|
2243
2249
|
}, holder?.id === row.id, this.store.unreadCount(row.id) + this.stalledWoken(row.id)),
|
|
2244
|
-
wakeable: tier === "live" || tier === "acp"
|
|
2250
|
+
wakeable: tier === "live" || tier === "acp",
|
|
2251
|
+
...this.lastSent.has(row.id) ? { lastSentAt: this.lastSent.get(row.id) } : {}
|
|
2245
2252
|
};
|
|
2246
2253
|
}
|
|
2247
2254
|
/** The orchestrator as routing sees it: the holder, if it is online. */
|
|
@@ -2876,9 +2883,9 @@ var Daemon = class {
|
|
|
2876
2883
|
clearTimeout(ask.timer);
|
|
2877
2884
|
ask.resolve(result);
|
|
2878
2885
|
}
|
|
2879
|
-
/** The worker left: its waiting requests end as
|
|
2886
|
+
/** The worker left: its waiting requests end as `worker_offline`. */
|
|
2880
2887
|
settleAsksOf(worker) {
|
|
2881
|
-
for (const [id, a] of this.asks) if (a.worker === worker) this.settleAsk(id, { answer: "
|
|
2888
|
+
for (const [id, a] of this.asks) if (a.worker === worker) this.settleAsk(id, { answer: "worker_offline" });
|
|
2882
2889
|
}
|
|
2883
2890
|
clearLead(conn) {
|
|
2884
2891
|
this.requireCli(conn, "clear the lead");
|
|
@@ -2924,12 +2931,14 @@ var Daemon = class {
|
|
|
2924
2931
|
const sender = this.requireSession(p.sessionId);
|
|
2925
2932
|
if (sender.status === "offline") throw new ConvenoError(RpcErrorCode.NotFound, `Session "${sender.name}" is offline. Register the session again before sending.`);
|
|
2926
2933
|
if (p.kind === "system") throw new ConvenoError(RpcErrorCode.InvalidParams, "Messages of kind \"system\" are made by the Conveno daemon only. Send kind \"text\" instead.");
|
|
2927
|
-
|
|
2934
|
+
const sent = this.deliverFrom({
|
|
2928
2935
|
id: sender.id,
|
|
2929
2936
|
name: sender.name,
|
|
2930
2937
|
cli: sender.cli,
|
|
2931
2938
|
hops: sender.status === "busy" ? sender.turnHops : 0
|
|
2932
2939
|
}, p);
|
|
2940
|
+
this.lastSent.set(sender.id, this.iso());
|
|
2941
|
+
return sent;
|
|
2933
2942
|
}
|
|
2934
2943
|
/** The recipient names the owner: `you`, or the id of a message the owner sent. */
|
|
2935
2944
|
isOwnerRecipient(to) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile, readdir } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { At as pendingHookContext, B as dataDir, G as dropFromList, J as endTurnContinuation, K as editJson, P as compareVersions, Pt as planLauncher, Tt as parseCliVersion, X as existedBefore, mn as uninstallLauncher, pt as late, rn as sameJson, ut as isObject, vt as loadJson, w as askedMarker, wt as ownSession, x as agentCommand, xt as needsQuoting } from "./dist-
|
|
3
|
+
import { At as pendingHookContext, B as dataDir, G as dropFromList, J as endTurnContinuation, K as editJson, P as compareVersions, Pt as planLauncher, Tt as parseCliVersion, X as existedBefore, mn as uninstallLauncher, pt as late, rn as sameJson, ut as isObject, vt as loadJson, w as askedMarker, wt as ownSession, x as agentCommand, xt as needsQuoting } from "./dist-ZL7d4_97.js";
|
|
4
4
|
// ../adapters/antigravity/dist/index.js
|
|
5
5
|
const SERVER_NAME = "conveno";
|
|
6
6
|
/** The name of our entry in hooks.json. Antigravity keys hooks by an arbitrary name. */
|
|
@@ -2,7 +2,7 @@ import { randomBytes as randomBytes$1 } from "@noble/ciphers/utils.js";
|
|
|
2
2
|
import { equalBytes } from "@noble/curves/utils.js";
|
|
3
3
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
4
4
|
import { bytesToHex, concatBytes, utf8ToBytes } from "@noble/hashes/utils.js";
|
|
5
|
-
import { Tn as DeviceId, ar as literal, cr as string, ir as discriminatedUnion, nr as array, or as number, sr as object, tr as _enum } from "./dist-
|
|
5
|
+
import { Tn as DeviceId, ar as literal, cr as string, ir as discriminatedUnion, nr as array, or as number, sr as object, tr as _enum } from "./dist-ZL7d4_97.js";
|
|
6
6
|
import { ed25519, x25519 } from "@noble/curves/ed25519.js";
|
|
7
7
|
import { chacha20poly1305 } from "@noble/ciphers/chacha.js";
|
|
8
8
|
import { expand, extract } from "@noble/hashes/hkdf.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { At as pendingHookContext, C as askedKey, G as dropFromList, Ht as readCommandLine, J as endTurnContinuation, K as editJson, Pt as planLauncher, Tt as parseCliVersion, U as defaultProcessIo, X as existedBefore, a as FROM_USER_NOTICE, c as ORCHESTRATOR_TASK_NOTICE, mn as uninstallLauncher, pt as late, rn as sameJson, s as NOT_FROM_USER_NOTICE, st as hostPidOf, ut as isObject, vt as loadJson, w as askedMarker, wt as ownSession, x as agentCommand, xt as needsQuoting, zt as putInList } from "./dist-
|
|
3
|
+
import { At as pendingHookContext, C as askedKey, G as dropFromList, Ht as readCommandLine, J as endTurnContinuation, K as editJson, Pt as planLauncher, Tt as parseCliVersion, U as defaultProcessIo, X as existedBefore, a as FROM_USER_NOTICE, c as ORCHESTRATOR_TASK_NOTICE, mn as uninstallLauncher, pt as late, rn as sameJson, s as NOT_FROM_USER_NOTICE, st as hostPidOf, ut as isObject, vt as loadJson, w as askedMarker, wt as ownSession, x as agentCommand, xt as needsQuoting, zt as putInList } from "./dist-ZL7d4_97.js";
|
|
4
4
|
import { n as cs, t as Za } from "./toml-patch-DGzVRdd1.js";
|
|
5
5
|
// ../adapters/grok/dist/index.js
|
|
6
6
|
const SERVER_NAME = "conveno";
|
|
@@ -3,7 +3,7 @@ import { mkdir, open, readFile, rm, stat } from "node:fs/promises";
|
|
|
3
3
|
import { createConnection } from "node:net";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
|
-
import { B as dataDir, Bn as defaultSocketPath, Fn as RpcResponse, Hn as ipcMethods, Mn as PROTOCOL_VERSION, N as clientProof, On as EventPayload, Pn as RpcErrorCode, Rt as proofsMatch, St as newAuthNonce, Un as isSocketPathTooLong, V as dataPaths, Vn as encodeFrame, er as socketPathTooLongMessage, i as ConvenoError, z as daemonProof, zn as createLineDecoder } from "./dist-
|
|
6
|
+
import { B as dataDir, Bn as defaultSocketPath, Fn as RpcResponse, Hn as ipcMethods, Mn as PROTOCOL_VERSION, N as clientProof, On as EventPayload, Pn as RpcErrorCode, Rt as proofsMatch, St as newAuthNonce, Un as isSocketPathTooLong, V as dataPaths, Vn as encodeFrame, er as socketPathTooLongMessage, i as ConvenoError, z as daemonProof, zn as createLineDecoder } from "./dist-ZL7d4_97.js";
|
|
7
7
|
// ../client/dist/index.js
|
|
8
8
|
const DEFAULT_REQUEST_TIMEOUT_MS = 5e3;
|
|
9
9
|
const DEFAULT_START_TIMEOUT_MS = 1e4;
|
|
@@ -2,7 +2,7 @@ import { execFile, spawn } from "node:child_process";
|
|
|
2
2
|
import { readFileSync, statSync } from "node:fs";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { At as pendingHookContext, Ft as planProgram, It as planSpawn, J as endTurnContinuation, Q as findOnPath, Tt as parseCliVersion, sn as startTurnContext, wt as ownSession } from "./dist-
|
|
5
|
+
import { At as pendingHookContext, Ft as planProgram, It as planSpawn, J as endTurnContinuation, Q as findOnPath, Tt as parseCliVersion, sn as startTurnContext, wt as ownSession } from "./dist-ZL7d4_97.js";
|
|
6
6
|
import { n as cs, t as Za } from "./toml-patch-DGzVRdd1.js";
|
|
7
7
|
// ../adapters/codex/dist/index.js
|
|
8
8
|
const SERVER_NAME = "conveno";
|
|
@@ -6196,6 +6196,8 @@ const Session = object({
|
|
|
6196
6196
|
unreadCount: number().int().min(0).optional(),
|
|
6197
6197
|
startedAt: IsoTimestamp,
|
|
6198
6198
|
lastSeenAt: IsoTimestamp,
|
|
6199
|
+
/** When the session last sent a message. Absent until it has sent one. */
|
|
6200
|
+
lastSentAt: IsoTimestamp.optional(),
|
|
6199
6201
|
/**
|
|
6200
6202
|
* The CLI's own id for this session (Codex's thread id), set by its hooks with
|
|
6201
6203
|
* `session.setNative`. Hooks of a CLI that runs many sessions in one process find theirs by it.
|
|
@@ -6529,6 +6531,7 @@ const ipcMethods = {
|
|
|
6529
6531
|
"allow_always",
|
|
6530
6532
|
"deny",
|
|
6531
6533
|
"unanswered",
|
|
6534
|
+
"worker_offline",
|
|
6532
6535
|
"no_spawner"
|
|
6533
6536
|
]),
|
|
6534
6537
|
by: SessionId.optional()
|
|
@@ -9225,7 +9228,7 @@ function accessAllows(access, call) {
|
|
|
9225
9228
|
const WORKER_UNANSWERED = ["deny", "allow"];
|
|
9226
9229
|
/** What workers may do, with the default when it was never chosen. */
|
|
9227
9230
|
function workerAccessOf(s) {
|
|
9228
|
-
return s.workerAccess ?? "
|
|
9231
|
+
return s.workerAccess ?? "full";
|
|
9229
9232
|
}
|
|
9230
9233
|
/** What happens to an unanswered request, with the default when it was never chosen. */
|
|
9231
9234
|
function workerUnansweredOf(s) {
|
|
@@ -9479,7 +9482,7 @@ function decodeAcpLaunchSpec(text) {
|
|
|
9479
9482
|
...typeof o.task === "string" && o.task !== "" ? { task: o.task } : {},
|
|
9480
9483
|
...typeof o.spawnedBy === "string" ? { spawnedBy: o.spawnedBy } : {},
|
|
9481
9484
|
from: str("from"),
|
|
9482
|
-
access: (typeof o.access === "string" ? parseWorkerAccess(o.access) : void 0) ?? "
|
|
9485
|
+
access: (typeof o.access === "string" ? parseWorkerAccess(o.access) : void 0) ?? "full",
|
|
9483
9486
|
...typeof o.mode === "string" && o.mode !== "" ? { mode: o.mode } : {},
|
|
9484
9487
|
...mcp && typeof mcp.command === "string" && strings(mcp.args) ? { mcp: {
|
|
9485
9488
|
command: mcp.command,
|
|
@@ -10171,7 +10174,7 @@ async function spawnSession(deps, req) {
|
|
|
10171
10174
|
confineToHome: req.confineToHome
|
|
10172
10175
|
});
|
|
10173
10176
|
const window = req.window === true;
|
|
10174
|
-
const access = req.access ?? deps.workerAccess?.() ?? "
|
|
10177
|
+
const access = req.access ?? deps.workerAccess?.() ?? "full";
|
|
10175
10178
|
const acpResolved = spec.acp ? resolveAcpProgram(cli, spec.acp, {
|
|
10176
10179
|
env: deps.env,
|
|
10177
10180
|
which: deps.which,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as connect } from "./dist-
|
|
2
|
-
import { $ as formatContinuation, Pn as RpcErrorCode, Rn as SessionId, g as accessAllows, hn as updateSpawnRecord, i as ConvenoError, ln as takeAcpLaunchFile, wn as CliKind } from "./dist-
|
|
1
|
+
import { n as connect } from "./dist-C59LTq60.js";
|
|
2
|
+
import { $ as formatContinuation, Pn as RpcErrorCode, Rn as SessionId, g as accessAllows, hn as updateSpawnRecord, i as ConvenoError, ln as takeAcpLaunchFile, wn as CliKind } from "./dist-ZL7d4_97.js";
|
|
3
3
|
import { randomBytes } from "node:crypto";
|
|
4
4
|
import { existsSync, rmSync } from "node:fs";
|
|
5
5
|
import { Readable, Writable } from "node:stream";
|
|
@@ -13,7 +13,11 @@ import { spawn, spawnSync } from "node:child_process";
|
|
|
13
13
|
*/
|
|
14
14
|
function answer(ask, allow) {
|
|
15
15
|
const want = allow ? "allow_once" : "reject_once";
|
|
16
|
-
const
|
|
16
|
+
const candidates = ask.options.filter((o) => o.kind === want);
|
|
17
|
+
const option = allow ? candidates[0] : candidates.find((o) => {
|
|
18
|
+
const text = `${o.optionId} ${o.name}`;
|
|
19
|
+
return /decline|continue/i.test(text) && !/cancel|abort|differently/i.test(text);
|
|
20
|
+
}) ?? candidates[0];
|
|
17
21
|
return option ? {
|
|
18
22
|
outcome: "selected",
|
|
19
23
|
optionId: option.optionId
|
|
@@ -33,6 +37,26 @@ const CONVENO_TOOL_TITLE = new RegExp(`^(?:(?:running|run|calling|call|using|use
|
|
|
33
37
|
"spawn_session",
|
|
34
38
|
"answer_permission"
|
|
35
39
|
].join("|")})$`, "i");
|
|
40
|
+
/** The hidden subcommand that starts Antigravity's idle-wake relay (`RELAY_SUBCOMMAND` of its adapter). */
|
|
41
|
+
const RELAY_SUBCOMMAND = "agy-relay";
|
|
42
|
+
/** One word of a command line: quoted (no quote, `$` or backtick inside), or bare without shell metacharacters. */
|
|
43
|
+
const WORD = String.raw`"[^"'\r\n$\`]+"|'[^"'\r\n$\`]+'|[^\s"'\r\n$\`&|;<>()^%!*?{}]+`;
|
|
44
|
+
const unquote = (w) => /^["']/.test(w) ? w.slice(1, -1) : w;
|
|
45
|
+
const baseName = (w) => unquote(w).split(/[\\/]/).pop() ?? "";
|
|
46
|
+
const RELAY_TITLE = new RegExp(`^(?:(?:running|run|calling|call|using|use|execute|invoke)\\s+)?(\`?)(?:&\\s+)?(${WORD})(?:\\s+(${WORD}))?\\s+${RELAY_SUBCOMMAND}\\1$`, "i");
|
|
47
|
+
/**
|
|
48
|
+
* Is this execute call exactly Conveno's relay command: `conveno agy-relay`, with a path, a
|
|
49
|
+
* `.cmd`, `.exe` or `.ps1` ending, or `node <path>/bin.js agy-relay`, and nothing chained after it.
|
|
50
|
+
*/
|
|
51
|
+
function isRelayCommand(call) {
|
|
52
|
+
if (call.kind !== "execute") return false;
|
|
53
|
+
const m = RELAY_TITLE.exec((call.title ?? "").trim());
|
|
54
|
+
if (!m) return false;
|
|
55
|
+
const first = m[2] ?? "";
|
|
56
|
+
const second = m[3];
|
|
57
|
+
if (second === void 0) return /^conveno(?:\.(?:cmd|exe|ps1))?$/i.test(baseName(first));
|
|
58
|
+
return /^node(?:\.exe)?$/i.test(baseName(first)) && /^bin\.js$/i.test(baseName(second));
|
|
59
|
+
}
|
|
36
60
|
/** Kinds whose title is a command line or a path, so a title that looks like a tool name is not one. */
|
|
37
61
|
const COMMAND_OR_FILE_KINDS = /* @__PURE__ */ new Set([
|
|
38
62
|
"execute",
|
|
@@ -57,7 +81,7 @@ var AllowListPolicy = class {
|
|
|
57
81
|
}
|
|
58
82
|
async decide(ask, _signal) {
|
|
59
83
|
const what = `${ask.title ?? "a tool call"} (${ask.kind ?? "other"})`;
|
|
60
|
-
const own = convenoToolOf(ask) !== void 0;
|
|
84
|
+
const own = convenoToolOf(ask) !== void 0 || isRelayCommand(ask);
|
|
61
85
|
if (own || this.allows({
|
|
62
86
|
kind: ask.kind,
|
|
63
87
|
title: ask.title
|
|
@@ -134,8 +158,9 @@ var AskSpawnerPolicy = class {
|
|
|
134
158
|
return this.allow(ask, what, `allowed ${what}: ${deps.spawnerName} said always`);
|
|
135
159
|
case "deny": return this.deny(ask, what, `denied by ${deps.spawnerName}`);
|
|
136
160
|
case "unanswered":
|
|
161
|
+
case "worker_offline":
|
|
137
162
|
case "no_spawner": {
|
|
138
|
-
const why = reply.answer === "unanswered" ? `no answer in ${waitText(timeoutMs)}` : "no spawner to ask";
|
|
163
|
+
const why = reply.answer === "unanswered" ? `no answer in ${waitText(timeoutMs)}` : reply.answer === "worker_offline" ? "the worker went offline while waiting" : "no spawner to ask";
|
|
139
164
|
return deps.unanswered === "allow" ? this.allow(ask, what, `allowed ${what}: ${why}`) : this.deny(ask, what, why);
|
|
140
165
|
}
|
|
141
166
|
}
|
|
@@ -180,7 +205,7 @@ var ToolTracker = class {
|
|
|
180
205
|
return u.sessionUpdate === "tool_call" ? next.title ?? next.kind ?? "tool" : void 0;
|
|
181
206
|
}
|
|
182
207
|
};
|
|
183
|
-
const HOST_VERSION = "0.2.0-rc.
|
|
208
|
+
const HOST_VERSION = "0.2.0-rc.15";
|
|
184
209
|
/** A stop request file: `conveno stop` writes it next to the spawn record. */
|
|
185
210
|
const stopRequestPath = (recordPath) => recordPath.replace(/\.json$/, ".stop");
|
|
186
211
|
function withTimeout(p, ms, what) {
|
|
@@ -239,6 +264,10 @@ var AcpHost = class {
|
|
|
239
264
|
deniedText;
|
|
240
265
|
/** The worker called Conveno's `send` (or `handoff`) in the turn that is running. */
|
|
241
266
|
sentThisTurn = false;
|
|
267
|
+
/** The daemon's `lastSentAt` of this session when the turn began. */
|
|
268
|
+
sentAtTurnStart;
|
|
269
|
+
/** Status updates go out one after another, so a late one cannot overwrite a newer one. */
|
|
270
|
+
statusChain = Promise.resolve();
|
|
242
271
|
lastStatus;
|
|
243
272
|
timers = [];
|
|
244
273
|
constructor(spec, deps) {
|
|
@@ -415,7 +444,7 @@ var AcpHost = class {
|
|
|
415
444
|
return null;
|
|
416
445
|
}
|
|
417
446
|
this.log(`turn.end failed: ${errText(e)}`);
|
|
418
|
-
await this.status("idle", null);
|
|
447
|
+
await this.status("idle", this.failedText ?? this.deniedText ?? null);
|
|
419
448
|
return null;
|
|
420
449
|
}
|
|
421
450
|
}
|
|
@@ -432,6 +461,7 @@ var AcpHost = class {
|
|
|
432
461
|
this.denials = [];
|
|
433
462
|
this.deniedText = void 0;
|
|
434
463
|
this.sentThisTurn = false;
|
|
464
|
+
this.sentAtTurnStart = await this.lastSentAt();
|
|
435
465
|
await this.status("busy", null);
|
|
436
466
|
const turn = conn.agent.request(methods.agent.session.prompt, {
|
|
437
467
|
sessionId: sid,
|
|
@@ -526,7 +556,7 @@ var AcpHost = class {
|
|
|
526
556
|
if (id !== void 0) this.noteConvenoCall(this.tools.tools.get(id));
|
|
527
557
|
if (doing !== void 0 && doing !== this.lastStatus) {
|
|
528
558
|
this.lastStatus = doing;
|
|
529
|
-
this.status(void 0, doing);
|
|
559
|
+
this.status(void 0, this.deniedText ?? doing);
|
|
530
560
|
}
|
|
531
561
|
}
|
|
532
562
|
async onPermission(p) {
|
|
@@ -566,11 +596,25 @@ var AcpHost = class {
|
|
|
566
596
|
if (!this.sessionId) return;
|
|
567
597
|
const text = typeof statusText === "string" ? statusText.slice(0, 200) : statusText;
|
|
568
598
|
if (status === void 0 && text === void 0) return;
|
|
569
|
-
|
|
570
|
-
|
|
599
|
+
const sessionId = this.sessionId;
|
|
600
|
+
const send = () => this.client["session.setStatus"]({
|
|
601
|
+
sessionId,
|
|
571
602
|
...status ? { status } : {},
|
|
572
603
|
...text !== void 0 ? { statusText: text } : {}
|
|
573
604
|
}).catch(() => void 0);
|
|
605
|
+
const done = this.statusChain.then(send, send);
|
|
606
|
+
this.statusChain = done;
|
|
607
|
+
await done;
|
|
608
|
+
}
|
|
609
|
+
/** When the daemon last saw this session send a message; undefined if never, or unknown. */
|
|
610
|
+
async lastSentAt() {
|
|
611
|
+
if (!this.sessionId) return void 0;
|
|
612
|
+
try {
|
|
613
|
+
const { sessions } = await this.client["session.list"]({ includeOffline: true });
|
|
614
|
+
return sessions.find((x) => x.id === this.sessionId)?.lastSentAt;
|
|
615
|
+
} catch {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
574
618
|
}
|
|
575
619
|
/** Show that the worker waits for its spawner's answer; null puts the usual status back. */
|
|
576
620
|
async waitingFor(title) {
|
|
@@ -623,7 +667,8 @@ var AcpHost = class {
|
|
|
623
667
|
const denials = this.denials;
|
|
624
668
|
this.denials = [];
|
|
625
669
|
if (!this.spec.spawnedBy) return;
|
|
626
|
-
|
|
670
|
+
let silent = finished && !this.sentThisTurn;
|
|
671
|
+
if (silent && await this.lastSentAt() !== this.sentAtTurnStart) silent = false;
|
|
627
672
|
if (denials.length === 0 && !silent) return;
|
|
628
673
|
const who = `[conveno] Worker ${this.spec.name} (${this.spec.cli}, over ACP)`;
|
|
629
674
|
const lines = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendFileSync } from "node:fs";
|
|
2
|
-
import { S as appendHookLog, it as hookLogLine } from "./dist-
|
|
2
|
+
import { S as appendHookLog, it as hookLogLine } from "./dist-ZL7d4_97.js";
|
|
3
3
|
import { n as connectOpts } from "./ctx-tYftvhz_.js";
|
|
4
4
|
// src/hook.ts
|
|
5
5
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as runHookEntry } from "./hook-entry-CvzyjOo4.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
|
-
import { n as antigravityAdapter } from "./dist-
|
|
2
|
+
import { n as antigravityAdapter } from "./dist-Bv1bmmme.js";
|
|
3
3
|
import { isAbsolute, join } from "node:path";
|
|
4
|
-
import { At as pendingHookContext, B as dataDir, Gt as readSettings, J as endTurnContinuation, Tt as parseCliVersion, V as dataPaths, Vt as readAncestry, Zt as requeueMessages, _n as waitForWork, at as hookLogPath, jt as pendingTurn, ot as hostAlive, r as CLAUDE_PENDING_TURN_FOLDER, sn as startTurnContext, vn as waitForWorkBatch, wt as ownSession } from "./dist-
|
|
4
|
+
import { At as pendingHookContext, B as dataDir, Gt as readSettings, J as endTurnContinuation, Tt as parseCliVersion, V as dataPaths, Vt as readAncestry, Zt as requeueMessages, _n as waitForWork, at as hookLogPath, jt as pendingTurn, ot as hostAlive, r as CLAUDE_PENDING_TURN_FOLDER, sn as startTurnContext, vn as waitForWorkBatch, wt as ownSession } from "./dist-ZL7d4_97.js";
|
|
5
5
|
import { readFile } from "node:fs/promises";
|
|
6
6
|
import { applyEdits, modify, parse, printParseErrorCode } from "jsonc-parser";
|
|
7
|
-
import { t as codexAdapter } from "./dist-
|
|
8
|
-
import { t as grokAdapter } from "./dist-
|
|
9
|
-
import { n as connect } from "./dist-
|
|
10
|
-
import { t as runHook } from "./hook-
|
|
7
|
+
import { t as codexAdapter } from "./dist-DDzIkwf9.js";
|
|
8
|
+
import { t as grokAdapter } from "./dist-C4KljaIP.js";
|
|
9
|
+
import { n as connect } from "./dist-C59LTq60.js";
|
|
10
|
+
import { t as runHook } from "./hook-BFZTvd7M.js";
|
|
11
11
|
// ../adapters/claude/dist/index.js
|
|
12
12
|
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
13
13
|
/** Read a JSON object file. Missing or blank files give `{}`; anything else that is not a JSON object throws. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Cn as CLI_KINDS, Ot as parseWorkerAccess, V as dataPaths, d as SPAWN_TABLE, f as SpawnError, on as spawnSession, p as WORKER_ACCESS, qt as realSpawnDeps, tn as runLaunchFile, u as SPAWN_CLIS } from "./dist-
|
|
2
|
-
import { A as runRelay, I as runAccount, L as runLogin, M as runDaemon, P as VERSION, R as runLogout, b as workerAccessLine, i as runDoctor, k as runDevices, m as runSetup, p as runInit, t as runUninstall } from "./uninstall-
|
|
3
|
-
import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-
|
|
4
|
-
import { t as daemonProblem } from "./daemonError-
|
|
1
|
+
import { Cn as CLI_KINDS, Ot as parseWorkerAccess, V as dataPaths, d as SPAWN_TABLE, f as SpawnError, on as spawnSession, p as WORKER_ACCESS, qt as realSpawnDeps, tn as runLaunchFile, u as SPAWN_CLIS } from "./dist-ZL7d4_97.js";
|
|
2
|
+
import { A as runRelay, I as runAccount, L as runLogin, M as runDaemon, P as VERSION, R as runLogout, b as workerAccessLine, i as runDoctor, k as runDevices, m as runSetup, p as runInit, t as runUninstall } from "./uninstall-DK25hyWX.js";
|
|
3
|
+
import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-CpAvszNY.js";
|
|
4
|
+
import { t as daemonProblem } from "./daemonError-Bj22X-4V.js";
|
|
5
5
|
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
6
6
|
import { join, resolve } from "node:path";
|
|
7
7
|
import { a as fail, c as plural, d as warnBlock, n as cmd, r as columns, s as plainError, t as closest, u as tilde } from "./fmt-C2SsP5Y0.js";
|
|
8
|
-
import { t as runHook } from "./hook-
|
|
8
|
+
import { t as runHook } from "./hook-BFZTvd7M.js";
|
|
9
9
|
import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
|
|
10
|
-
import { t as findSession } from "./pick-
|
|
10
|
+
import { t as findSession } from "./pick-DaCRjuyz.js";
|
|
11
11
|
import { readFileSync } from "node:fs";
|
|
12
12
|
// src/errorLog.ts
|
|
13
13
|
/** The message of an unexpected error, as it is. Not the softened text `plainError` gives. */
|
|
@@ -335,8 +335,6 @@ async function runSpawn(ctx, argv) {
|
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
337
|
try {
|
|
338
|
-
const { hostPid } = await ctx.ancestry(8e3);
|
|
339
|
-
const requester = hostPid === void 0 ? void 0 : (await client["session.byHost"]({ pid: hostPid }).catch(() => void 0))?.session ?? void 0;
|
|
340
338
|
const runner = ctx.spawnRunner ?? [process.execPath, process.argv[1] ?? "conveno"];
|
|
341
339
|
const deps = realSpawnDeps({
|
|
342
340
|
platform: ctx.platform,
|
|
@@ -354,12 +352,11 @@ async function runSpawn(ctx, argv) {
|
|
|
354
352
|
task,
|
|
355
353
|
window,
|
|
356
354
|
access,
|
|
357
|
-
requester,
|
|
358
355
|
confineToHome: false,
|
|
359
356
|
onProgress: (line) => ctx.err(`${t.paint("quiet", line)}\n`)
|
|
360
357
|
});
|
|
361
358
|
const how = res.window ? res.terminal ?? "terminal" : "background";
|
|
362
|
-
ctx.out(`${t.status("ok")} ${t.bold(`Started ${res.name}`)} ${t.paint("quiet", `(${res.cli}, ${how}) in ${tilde(res.cwd, ctx.home)}
|
|
359
|
+
ctx.out(`${t.status("ok")} ${t.bold(`Started ${res.name}`)} ${t.paint("quiet", `(${res.cli}, ${how}) in ${tilde(res.cwd, ctx.home)}`)}\n`);
|
|
363
360
|
if (res.task === "message") ctx.out(` The first task was sent to it as a Conveno message.\n`);
|
|
364
361
|
if (!res.window) {
|
|
365
362
|
ctx.out(` End it with ${cmd(t, `conveno stop ${res.name}`)}.\n`);
|
|
@@ -588,11 +585,11 @@ async function dispatch(name, rest, ctx) {
|
|
|
588
585
|
case "rename": return runRename(ctx, rest);
|
|
589
586
|
case "lead": return runLead(ctx, rest);
|
|
590
587
|
case "spawn": return runSpawn(ctx, rest);
|
|
591
|
-
case "acp-host": return (await import("./acp-
|
|
592
|
-
case "stop": return (await import("./acp-
|
|
588
|
+
case "acp-host": return (await import("./acp-DZf0zyNC.js")).runAcpHostCmd(ctx, rest);
|
|
589
|
+
case "stop": return (await import("./acp-DZf0zyNC.js")).runStop(ctx, rest);
|
|
593
590
|
case "spawn-run": return runSpawnRun(ctx, rest);
|
|
594
|
-
case "agy-relay": return (await import("./agy-relay-
|
|
595
|
-
case "watch": return (await import("./watch-
|
|
591
|
+
case "agy-relay": return (await import("./agy-relay-DSRJtMz3.js")).runAgyRelay(ctx, rest);
|
|
592
|
+
case "watch": return (await import("./watch-De3wbdQL.js")).runWatch(ctx, rest);
|
|
596
593
|
case "devices": return runDevices(ctx, rest);
|
|
597
594
|
case "relay": return runRelay(ctx, rest);
|
|
598
595
|
case "doctor": return runDoctor(ctx, rest);
|
|
@@ -631,7 +628,7 @@ function opensApp(env, tty = {
|
|
|
631
628
|
async function main(argv, ctx) {
|
|
632
629
|
const [command, ...rest] = argv;
|
|
633
630
|
if (command === void 0 && opensApp(ctx.env)) try {
|
|
634
|
-
return await (await import("./run-
|
|
631
|
+
return await (await import("./run-CKiYjNqx.js")).runTui(ctx);
|
|
635
632
|
} catch (e) {
|
|
636
633
|
ctx.err(`The app could not start (${rawMessage(e)}). Showing the help instead.\n`);
|
|
637
634
|
ctx.out(helpText(ctx));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Box, Text, render, useApp, useInput, useStdin, useStdout } from "ink";
|
|
2
2
|
import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
|
|
3
|
-
import { C as saveChoice, D as warmAcpAdapters, E as unifiedDiff, F as openInBrowser, N as stopDaemonIfRunning, O as PAIR_TIMEOUT_MS, S as connectedTools, T as applyChanges, _ as readWorkerAccess, a as applyOptions, c as collectPlans, d as refreshManifest, f as renewedApprovals, g as UNANSWERED_TEXT, h as ACCESS_TEXT, j as replaceStaleDaemon, l as detectAll, n as inspect, o as approvalWrites, r as partState, s as approvedBySetup, t as runUninstall, u as pendingOptions, v as saveWorkerAccess, w as StaleError, x as chosenTools, y as waitText, z as showCode$1 } from "./uninstall-
|
|
4
|
-
import { t as daemonProblem } from "./daemonError-
|
|
3
|
+
import { C as saveChoice, D as warmAcpAdapters, E as unifiedDiff, F as openInBrowser, N as stopDaemonIfRunning, O as PAIR_TIMEOUT_MS, S as connectedTools, T as applyChanges, _ as readWorkerAccess, a as applyOptions, c as collectPlans, d as refreshManifest, f as renewedApprovals, g as UNANSWERED_TEXT, h as ACCESS_TEXT, j as replaceStaleDaemon, l as detectAll, n as inspect, o as approvalWrites, r as partState, s as approvedBySetup, t as runUninstall, u as pendingOptions, v as saveWorkerAccess, w as StaleError, x as chosenTools, y as waitText, z as showCode$1 } from "./uninstall-DK25hyWX.js";
|
|
4
|
+
import { t as daemonProblem } from "./daemonError-Bj22X-4V.js";
|
|
5
5
|
import { a as fail, n as cmd, s as plainError, u as tilde } from "./fmt-C2SsP5Y0.js";
|
|
6
6
|
import { createContext, useContext, useEffect, useImperativeHandle, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
7
|
-
import { Bt as readAccountTokens, F as compatStatus, Gt as readSettings, I as completeLogin, It as planSpawn, Kt as readSpawnRecord, Ln as SESSION_NAME_PATTERN, Lt as pollDeviceCode, Q as findOnPath, Sn as writeSettings, U as defaultProcessIo, V as dataPaths, Wt as readProcessList, Yt as requestDeviceCode, Z as fetchAccountStatus, an as spawnRecordPath, h as WORKER_UNANSWERED, m as WORKER_ASK_TIMEOUT_CHOICES, n as AccountError, on as spawnSession, p as WORKER_ACCESS, qt as realSpawnDeps, yt as logoutAccount } from "./dist-
|
|
7
|
+
import { Bt as readAccountTokens, F as compatStatus, Gt as readSettings, I as completeLogin, It as planSpawn, Kt as readSpawnRecord, Ln as SESSION_NAME_PATTERN, Lt as pollDeviceCode, Q as findOnPath, Sn as writeSettings, U as defaultProcessIo, V as dataPaths, Wt as readProcessList, Yt as requestDeviceCode, Z as fetchAccountStatus, an as spawnRecordPath, h as WORKER_UNANSWERED, m as WORKER_ASK_TIMEOUT_CHOICES, n as AccountError, on as spawnSession, p as WORKER_ACCESS, qt as realSpawnDeps, yt as logoutAccount } from "./dist-ZL7d4_97.js";
|
|
8
8
|
import { i as tokens, n as detectColorLevel, r as detectUnicode } from "./dist-BRjg9CLd.js";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { readFileSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -12,7 +12,7 @@ import { Readable } from "node:stream";
|
|
|
12
12
|
import { basename, posix, win32 } from "node:path";
|
|
13
13
|
import { spawn } from "node:child_process";
|
|
14
14
|
import { homedir } from "node:os";
|
|
15
|
-
import { r as stopRequestPath, t as killProcessTree } from "./dist-
|
|
15
|
+
import { r as stopRequestPath, t as killProcessTree } from "./dist-fI_XSoCQ.js";
|
|
16
16
|
// src/tui/home/deps.ts
|
|
17
17
|
/**
|
|
18
18
|
* What home does outside the store: sign in and out, and take Conveno away. Real in the app, fake
|
|
@@ -269,7 +269,6 @@ function ScrollView({ lines, height, stickToBottom = false, isActive = true, onA
|
|
|
269
269
|
* so the shell shows a hint instead of quitting.
|
|
270
270
|
*/
|
|
271
271
|
const DraftContext = createContext({ cleared: () => void 0 });
|
|
272
|
-
DraftContext.Provider;
|
|
273
272
|
/** A small input. Enter sends; Shift+Enter (or Ctrl+J) adds a line when `multiline`. */
|
|
274
273
|
function TextBox({ value, onChange, onSubmit, placeholder, focus, multiline, onCancel, onFocusRequest }) {
|
|
275
274
|
const { c, ascii } = useTheme();
|
|
@@ -4232,7 +4231,7 @@ const initialState = (start) => ({
|
|
|
4232
4231
|
tools: null,
|
|
4233
4232
|
signedIn: false,
|
|
4234
4233
|
picked: [],
|
|
4235
|
-
access: "
|
|
4234
|
+
access: "full",
|
|
4236
4235
|
dropped: [],
|
|
4237
4236
|
questions: [],
|
|
4238
4237
|
qIndex: 0,
|
|
@@ -4,18 +4,18 @@ import { homedir } from "node:os";
|
|
|
4
4
|
import { delimiter, join, win32 } from "node:path";
|
|
5
5
|
import { createInterface } from "node:readline";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { n as antigravityAdapter } from "./dist-
|
|
8
|
-
import { a as opencodeAdapter, o as claudeAdapter, r as readAllStdin } from "./hook-entry-
|
|
9
|
-
import { t as codexAdapter } from "./dist-
|
|
10
|
-
import { t as grokAdapter } from "./dist-
|
|
7
|
+
import { n as antigravityAdapter } from "./dist-Bv1bmmme.js";
|
|
8
|
+
import { a as opencodeAdapter, o as claudeAdapter, r as readAllStdin } from "./hook-entry-CvzyjOo4.js";
|
|
9
|
+
import { t as codexAdapter } from "./dist-DDzIkwf9.js";
|
|
10
|
+
import { t as grokAdapter } from "./dist-C4KljaIP.js";
|
|
11
11
|
import { t as createTheme } from "./dist-BRjg9CLd.js";
|
|
12
|
-
import { n as connect$1 } from "./dist-
|
|
13
|
-
import { An as MessageId, B as dataDir, Cn as CLI_KINDS, Dt as parsePs1ShimTarget, Et as parseCmdShimTarget, Ht as readCommandLine, It as planSpawn, Mt as pidAlive, O as baseName, Pn as RpcErrorCode, Rn as SessionId, T as attachAcpSession, Vt as readAncestry, W as detectRepo, cr as string, ct as isAntigravityApp, en as resolveWindowsCommand, f as SpawnError, gn as validateRename, ht as launcherText, i as ConvenoError, j as claimSpawnRecord, jn as OWNER_SESSION_ID, jt as pendingTurn, mt as launcherPath, nr as array, o as HEARTBEAT_INTERVAL_MS, on as spawnSession, or as number, qt as realSpawnDeps, rr as boolean, s as NOT_FROM_USER_NOTICE, tr as _enum, tt as formatInbox, u as SPAWN_CLIS, xt as needsQuoting } from "./dist-
|
|
14
|
-
import "./dist-
|
|
12
|
+
import { n as connect$1 } from "./dist-C59LTq60.js";
|
|
13
|
+
import { An as MessageId, B as dataDir, Cn as CLI_KINDS, Dt as parsePs1ShimTarget, Et as parseCmdShimTarget, Ht as readCommandLine, It as planSpawn, Mt as pidAlive, O as baseName, Pn as RpcErrorCode, Rn as SessionId, T as attachAcpSession, Vt as readAncestry, W as detectRepo, cr as string, ct as isAntigravityApp, en as resolveWindowsCommand, f as SpawnError, gn as validateRename, ht as launcherText, i as ConvenoError, j as claimSpawnRecord, jn as OWNER_SESSION_ID, jt as pendingTurn, mt as launcherPath, nr as array, o as HEARTBEAT_INTERVAL_MS, on as spawnSession, or as number, qt as realSpawnDeps, rr as boolean, s as NOT_FROM_USER_NOTICE, tr as _enum, tt as formatInbox, u as SPAWN_CLIS, xt as needsQuoting } from "./dist-ZL7d4_97.js";
|
|
14
|
+
import "./dist-Bx22a5AV.js";
|
|
15
15
|
import { access } from "node:fs/promises";
|
|
16
16
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
17
17
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
18
|
-
// ../daemon/dist/server-
|
|
18
|
+
// ../daemon/dist/server-D8I5bfil.js
|
|
19
19
|
/** `kill(pid, 0)` liveness: EPERM means the process exists but belongs to someone else. */
|
|
20
20
|
function defaultIsAlive(pid) {
|
|
21
21
|
try {
|
|
@@ -28,7 +28,7 @@ function defaultIsAlive(pid) {
|
|
|
28
28
|
`${OWNER_SESSION_ID}`;
|
|
29
29
|
SessionId.parse("0".repeat(26));
|
|
30
30
|
// ../mcp/dist/index.js
|
|
31
|
-
const SERVER_VERSION = "0.2.0-rc.
|
|
31
|
+
const SERVER_VERSION = "0.2.0-rc.15";
|
|
32
32
|
const ok = (text) => ({ content: [{
|
|
33
33
|
type: "text",
|
|
34
34
|
text
|
|
@@ -483,7 +483,7 @@ function createServer(opts) {
|
|
|
483
483
|
"read",
|
|
484
484
|
"edit",
|
|
485
485
|
"full"
|
|
486
|
-
]).optional().describe("Optional. What the worker may do without asking: read (look only), edit (also change files; the default
|
|
486
|
+
]).optional().describe("Optional. What the worker may do without asking: read (look only), edit (also change files) or full (everything; the default unless the user changed it). Not for window workers.")
|
|
487
487
|
}
|
|
488
488
|
}, tool(async (me, a) => {
|
|
489
489
|
const deps = opts.spawnDeps ?? realSpawnDeps({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Bt as readAccountTokens, Cn as CLI_KINDS, F as compatStatus, Gt as readSettings, I as completeLogin, It as planSpawn, Lt as pollDeviceCode, Nt as pinnedAdapter, Q as findOnPath, Qt as resolveAcpProgram, Sn as writeSettings, V as dataPaths, Yt as requestDeviceCode, Z as fetchAccountStatus, b as adapterNpxCommand, bn as workerAskTimeoutOf, d as SPAWN_TABLE, n as AccountError, p as WORKER_ACCESS, v as acpOverrideVar, xn as workerUnansweredOf, y as adapterInstallCommand, yn as workerAccessOf, yt as logoutAccount } from "./dist-
|
|
1
|
+
import { Bt as readAccountTokens, Cn as CLI_KINDS, F as compatStatus, Gt as readSettings, I as completeLogin, It as planSpawn, Lt as pollDeviceCode, Nt as pinnedAdapter, Q as findOnPath, Qt as resolveAcpProgram, Sn as writeSettings, V as dataPaths, Yt as requestDeviceCode, Z as fetchAccountStatus, b as adapterNpxCommand, bn as workerAskTimeoutOf, d as SPAWN_TABLE, n as AccountError, p as WORKER_ACCESS, v as acpOverrideVar, xn as workerUnansweredOf, y as adapterInstallCommand, yn as workerAccessOf, yt as logoutAccount } from "./dist-ZL7d4_97.js";
|
|
2
2
|
import { a as fail, c as plural, d as warnBlock, i as errorBlock, l as seconds, n as cmd, o as localStamp, r as columns, s as plainError, t as closest, u as tilde } from "./fmt-C2SsP5Y0.js";
|
|
3
|
-
import { a as parseFlags, n as COMMANDS } from "./args-
|
|
3
|
+
import { a as parseFlags, n as COMMANDS } from "./args-CpAvszNY.js";
|
|
4
4
|
import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
|
|
5
|
-
import { t as daemonProblem } from "./daemonError-
|
|
5
|
+
import { t as daemonProblem } from "./daemonError-Bj22X-4V.js";
|
|
6
6
|
import { basename, dirname, isAbsolute, join } from "node:path";
|
|
7
7
|
import { execFile, spawn } from "node:child_process";
|
|
8
8
|
import { access, chmod, mkdir, open, readFile, readdir, realpath, rename as rename$1, rm, rmdir, stat, writeFile } from "node:fs/promises";
|
|
@@ -141,7 +141,7 @@ async function runAccount(ctx, argv, io = {}) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
// src/version.ts
|
|
144
|
-
const VERSION = "0.2.0-rc.
|
|
144
|
+
const VERSION = "0.2.0-rc.15";
|
|
145
145
|
// src/daemon.ts
|
|
146
146
|
async function lockPid(ctx) {
|
|
147
147
|
try {
|
|
@@ -294,7 +294,7 @@ async function replaceStaleDaemon(ctx) {
|
|
|
294
294
|
} catch {
|
|
295
295
|
return null;
|
|
296
296
|
}
|
|
297
|
-
if (running === void 0 || running === "0.2.0-rc.
|
|
297
|
+
if (running === void 0 || running === "0.2.0-rc.15") return null;
|
|
298
298
|
return await stopDaemon({
|
|
299
299
|
...ctx,
|
|
300
300
|
out: () => void 0,
|
|
@@ -1925,7 +1925,7 @@ async function runSetup(ctx, argv) {
|
|
|
1925
1925
|
});
|
|
1926
1926
|
if (ctx.interactive && v.yes !== true && v["dry-run"] !== true) {
|
|
1927
1927
|
if (isWorkerAccess(access)) saveWorkerAccess(ctx, { access });
|
|
1928
|
-
return (await import("./run-
|
|
1928
|
+
return (await import("./run-CKiYjNqx.js")).runTui(ctx, { start: "setup" });
|
|
1929
1929
|
}
|
|
1930
1930
|
return runInit(ctx, argv, "setup");
|
|
1931
1931
|
}
|
|
@@ -2046,7 +2046,7 @@ async function runDoctor(ctx, argv = []) {
|
|
|
2046
2046
|
try {
|
|
2047
2047
|
const { sessions } = await client["session.list"]({});
|
|
2048
2048
|
const running = client.daemonVersion;
|
|
2049
|
-
if (running !== void 0 && running !== "0.2.0-rc.
|
|
2049
|
+
if (running !== void 0 && running !== "0.2.0-rc.15") {
|
|
2050
2050
|
daemonLine = [` ${t.status("warn")} daemon`, `running ${running}, this is ${VERSION}`];
|
|
2051
2051
|
warnings++;
|
|
2052
2052
|
notes.push(warnBlock(t, "Conveno's background service is from an older version.", `Run ${cmd(t, "conveno")} to restart it, or ${cmd(t, "conveno daemon stop")} and open your AI tools again.`, `The service running now is ${running}; this install is ${VERSION}. ${cmd(t, "conveno")} and ${cmd(t, "conveno setup")} restart it for you.`));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as isOneShotGrok } from "./dist-
|
|
2
|
-
import { Jt as renderBody, in as senderOf, lt as isFromOwner, nn as runWaker } from "./dist-
|
|
1
|
+
import { n as isOneShotGrok } from "./dist-C4KljaIP.js";
|
|
2
|
+
import { Jt as renderBody, in as senderOf, lt as isFromOwner, nn as runWaker } from "./dist-ZL7d4_97.js";
|
|
3
3
|
import { n as connectOpts } from "./ctx-tYftvhz_.js";
|
|
4
|
-
import { t as daemonProblem } from "./daemonError-
|
|
5
|
-
import { t as findSession } from "./pick-
|
|
4
|
+
import { t as daemonProblem } from "./daemonError-Bj22X-4V.js";
|
|
5
|
+
import { t as findSession } from "./pick-DaCRjuyz.js";
|
|
6
6
|
// src/watch.ts
|
|
7
7
|
const CONNECT_MAX_RETRY_MS = 3e4;
|
|
8
8
|
const CONNECT_GIVE_UP_MS = 3e5;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conveno/cli",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.15",
|
|
4
4
|
"description": "Connect AI coding CLI sessions so they can message each other.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -52,18 +52,18 @@
|
|
|
52
52
|
"zod": "4.6.7"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@conveno/acp": "0.2.0-rc.
|
|
56
|
-
"@conveno/adapter-antigravity": "0.2.0-rc.
|
|
57
|
-
"@conveno/adapter-claude": "0.2.0-rc.
|
|
58
|
-
"@conveno/adapter-codex": "0.2.0-rc.
|
|
59
|
-
"@conveno/adapter-grok": "0.2.0-rc.
|
|
60
|
-
"@conveno/adapter-opencode": "0.2.0-rc.
|
|
61
|
-
"@conveno/brand": "0.2.0-rc.
|
|
62
|
-
"@conveno/client": "0.2.0-rc.
|
|
63
|
-
"@conveno/core": "0.2.0-rc.
|
|
64
|
-
"@conveno/daemon": "0.2.0-rc.
|
|
65
|
-
"@conveno/mcp": "0.2.0-rc.
|
|
66
|
-
"@conveno/protocol": "0.2.0-rc.
|
|
55
|
+
"@conveno/acp": "0.2.0-rc.15",
|
|
56
|
+
"@conveno/adapter-antigravity": "0.2.0-rc.15",
|
|
57
|
+
"@conveno/adapter-claude": "0.2.0-rc.15",
|
|
58
|
+
"@conveno/adapter-codex": "0.2.0-rc.15",
|
|
59
|
+
"@conveno/adapter-grok": "0.2.0-rc.15",
|
|
60
|
+
"@conveno/adapter-opencode": "0.2.0-rc.15",
|
|
61
|
+
"@conveno/brand": "0.2.0-rc.15",
|
|
62
|
+
"@conveno/client": "0.2.0-rc.15",
|
|
63
|
+
"@conveno/core": "0.2.0-rc.15",
|
|
64
|
+
"@conveno/daemon": "0.2.0-rc.15",
|
|
65
|
+
"@conveno/mcp": "0.2.0-rc.15",
|
|
66
|
+
"@conveno/protocol": "0.2.0-rc.15",
|
|
67
67
|
"@types/react": "19.3.0",
|
|
68
68
|
"ink-testing-library": "4.0.0"
|
|
69
69
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { i as runHookEntry } from "./hook-entry-Cxh3yIdT.js";
|