@gorlitzer-labs/apiary 1.13.6 → 1.13.8
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 +31 -6
- package/dist/agent/index.js +2 -2
- package/dist/{chunk-7JXPJO3R.js → chunk-3O76FESR.js} +4 -4
- package/dist/{chunk-4A7MREYX.js → chunk-63Q3KJ4W.js} +2 -2
- package/dist/{chunk-BCQQJR5E.js → chunk-FTN3D6WM.js} +3 -3
- package/dist/{chunk-MEWZT5KA.js → chunk-J3T2PS3M.js} +2 -2
- package/dist/{chunk-TISBXM4R.js → chunk-LN6ATWE3.js} +157 -157
- package/dist/chunk-LN6ATWE3.js.map +1 -0
- package/dist/{chunk-HTNCLNPX.js → chunk-XKFWEK7W.js} +4 -4
- package/dist/{chunk-TMXQDGMN.js → chunk-YP4K2A7G.js} +30 -30
- package/dist/chunk-YP4K2A7G.js.map +1 -0
- package/dist/cli/index.js +62 -44
- package/dist/cli/index.js.map +1 -1
- package/dist/{invites-GRROUSCE.js → invites-YZWCUC67.js} +5 -5
- package/dist/{join-H62VB4HU.js → join-FSKOS5BO.js} +5 -5
- package/dist/{room-IHVB5CWO.js → room-MAUAV2XD.js} +7 -7
- package/dist/{room-IHVB5CWO.js.map → room-MAUAV2XD.js.map} +1 -1
- package/dist/{run-UJO7NO3C.js → run-4EJB2KC3.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-TISBXM4R.js.map +0 -1
- package/dist/chunk-TMXQDGMN.js.map +0 -1
- /package/dist/{chunk-7JXPJO3R.js.map → chunk-3O76FESR.js.map} +0 -0
- /package/dist/{chunk-4A7MREYX.js.map → chunk-63Q3KJ4W.js.map} +0 -0
- /package/dist/{chunk-BCQQJR5E.js.map → chunk-FTN3D6WM.js.map} +0 -0
- /package/dist/{chunk-MEWZT5KA.js.map → chunk-J3T2PS3M.js.map} +0 -0
- /package/dist/{chunk-HTNCLNPX.js.map → chunk-XKFWEK7W.js.map} +0 -0
- /package/dist/{invites-GRROUSCE.js.map → invites-YZWCUC67.js.map} +0 -0
- /package/dist/{join-H62VB4HU.js.map → join-FSKOS5BO.js.map} +0 -0
- /package/dist/{run-UJO7NO3C.js.map → run-4EJB2KC3.js.map} +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
join
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-3O76FESR.js";
|
|
5
5
|
import {
|
|
6
6
|
deliverInvite,
|
|
7
7
|
sameApiaryServer
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-J3T2PS3M.js";
|
|
9
9
|
import {
|
|
10
10
|
checkForUpdate,
|
|
11
11
|
printUpdateNotice
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
tmuxSendEnter,
|
|
33
33
|
tmuxSendKey,
|
|
34
34
|
tmuxSessionExists
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-FTN3D6WM.js";
|
|
36
36
|
import "../chunk-PEB6HEFT.js";
|
|
37
37
|
import {
|
|
38
38
|
buildRuntimeMcpOptions
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-XKFWEK7W.js";
|
|
40
40
|
import {
|
|
41
41
|
EventProcessor,
|
|
42
42
|
RUNTIME_TOOL_NAMES,
|
|
@@ -44,16 +44,16 @@ import {
|
|
|
44
44
|
createRuntimeMcpServer,
|
|
45
45
|
parseEngagementMode,
|
|
46
46
|
shouldReportActivity
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-LN6ATWE3.js";
|
|
48
48
|
import {
|
|
49
49
|
buildShareUrl
|
|
50
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-63Q3KJ4W.js";
|
|
51
51
|
import {
|
|
52
52
|
randomName
|
|
53
53
|
} from "../chunk-D7DXZQWT.js";
|
|
54
54
|
import {
|
|
55
55
|
contentPartsToString
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-YP4K2A7G.js";
|
|
57
57
|
import "../chunk-BZ4VDWC2.js";
|
|
58
58
|
|
|
59
59
|
// src/cli/claude/run.ts
|
|
@@ -769,9 +769,9 @@ async function runClaude(options) {
|
|
|
769
769
|
});
|
|
770
770
|
process.stderr.write(`MCP server: ${setup2.mcpServer.url}
|
|
771
771
|
`);
|
|
772
|
-
await new Promise((
|
|
773
|
-
process.on("SIGINT",
|
|
774
|
-
process.on("SIGTERM",
|
|
772
|
+
await new Promise((resolve4) => {
|
|
773
|
+
process.on("SIGINT", resolve4);
|
|
774
|
+
process.on("SIGTERM", resolve4);
|
|
775
775
|
});
|
|
776
776
|
await setup2.cleanup();
|
|
777
777
|
await eventLoopPromise2;
|
|
@@ -916,9 +916,9 @@ async function runClaude(options) {
|
|
|
916
916
|
const noop = (() => true);
|
|
917
917
|
process.stdout.write = noop;
|
|
918
918
|
process.stderr.write = noop;
|
|
919
|
-
await new Promise((
|
|
920
|
-
process.on("SIGTERM",
|
|
921
|
-
process.on("SIGINT",
|
|
919
|
+
await new Promise((resolve4) => {
|
|
920
|
+
process.on("SIGTERM", resolve4);
|
|
921
|
+
process.on("SIGINT", resolve4);
|
|
922
922
|
});
|
|
923
923
|
clearInterval(activityTimer);
|
|
924
924
|
clearInterval(metricsTimer);
|
|
@@ -948,9 +948,9 @@ async function runClaude(options) {
|
|
|
948
948
|
const noop = (() => true);
|
|
949
949
|
process.stdout.write = noop;
|
|
950
950
|
process.stderr.write = noop;
|
|
951
|
-
await new Promise((
|
|
952
|
-
process.on("SIGINT",
|
|
953
|
-
process.on("SIGTERM",
|
|
951
|
+
await new Promise((resolve4) => {
|
|
952
|
+
process.on("SIGINT", resolve4);
|
|
953
|
+
process.on("SIGTERM", resolve4);
|
|
954
954
|
});
|
|
955
955
|
}
|
|
956
956
|
clearInterval(activityTimer);
|
|
@@ -1181,12 +1181,12 @@ async function runOpencode(options) {
|
|
|
1181
1181
|
OpenCode agent running.`);
|
|
1182
1182
|
console.log(` To watch: opencode attach ${opencodeUrl}
|
|
1183
1183
|
`);
|
|
1184
|
-
const exitPromise = new Promise((
|
|
1185
|
-
child.on("exit",
|
|
1184
|
+
const exitPromise = new Promise((resolve4) => {
|
|
1185
|
+
child.on("exit", resolve4);
|
|
1186
1186
|
});
|
|
1187
|
-
const signalPromise = new Promise((
|
|
1187
|
+
const signalPromise = new Promise((resolve4) => {
|
|
1188
1188
|
const handler = () => {
|
|
1189
|
-
|
|
1189
|
+
resolve4();
|
|
1190
1190
|
};
|
|
1191
1191
|
process.on("SIGINT", handler);
|
|
1192
1192
|
process.on("SIGTERM", handler);
|
|
@@ -1369,7 +1369,11 @@ var BLOCKED_PATTERNS = [
|
|
|
1369
1369
|
// `[\s\S]` not `.`: the screen renders these on separate lines, and `.`
|
|
1370
1370
|
// does not cross a newline, so the original pattern never matched.
|
|
1371
1371
|
/You are running Codex in [\s\S]+Do you want to allow/,
|
|
1372
|
-
"Do you trust the files in this folder"
|
|
1372
|
+
"Do you trust the files in this folder",
|
|
1373
|
+
// Codex 0.156 reworded the trust prompt; the old string above no longer appears.
|
|
1374
|
+
"Trust this folder?",
|
|
1375
|
+
// The startup update menu ("Update now / Skip") sits in front of the composer too.
|
|
1376
|
+
/Update available[\s\S]+Update now/
|
|
1373
1377
|
];
|
|
1374
1378
|
var STREAMING_PATTERNS = [
|
|
1375
1379
|
/Working\s*\(\d+[smh]/,
|
|
@@ -1657,8 +1661,8 @@ function extractCodexActivityLabel(lines) {
|
|
|
1657
1661
|
}
|
|
1658
1662
|
|
|
1659
1663
|
// src/cli/codex/launch.ts
|
|
1660
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readdirSync as readdirSync4, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
1661
|
-
import { join as join6 } from "path";
|
|
1664
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readdirSync as readdirSync4, realpathSync as realpathSync2, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
1665
|
+
import { join as join6, resolve as resolve2 } from "path";
|
|
1662
1666
|
import { homedir as homedir5 } from "os";
|
|
1663
1667
|
var STARTUP_TIMEOUT_SEC = 15;
|
|
1664
1668
|
var TOOL_TIMEOUT_SEC = 60;
|
|
@@ -1679,7 +1683,7 @@ function codexProfileName(agentName) {
|
|
|
1679
1683
|
function tomlString(value) {
|
|
1680
1684
|
return JSON.stringify(value);
|
|
1681
1685
|
}
|
|
1682
|
-
function renderCodexProfile(mcpUrl, approvalMode = codexToolApprovalMode(), unattended = wantsUnattendedAgents()) {
|
|
1686
|
+
function renderCodexProfile(mcpUrl, approvalMode = codexToolApprovalMode(), unattended = wantsUnattendedAgents(), trustDirs = []) {
|
|
1683
1687
|
const blocks = [
|
|
1684
1688
|
// Top-level keys must precede every table header, or TOML parses them as
|
|
1685
1689
|
// members of the last table.
|
|
@@ -1689,7 +1693,9 @@ function renderCodexProfile(mcpUrl, approvalMode = codexToolApprovalMode(), unat
|
|
|
1689
1693
|
"# No approval prompts: nobody is watching this pane, so a prompt is a",
|
|
1690
1694
|
"# permanent stall. Commands still run inside Codex's sandbox \u2014 anything",
|
|
1691
1695
|
"# it will not allow returns a failure to the model instead of asking.",
|
|
1692
|
-
'approval_policy = "never"'
|
|
1696
|
+
'approval_policy = "never"',
|
|
1697
|
+
"# The update prompt is a menu in front of the composer: another stall.",
|
|
1698
|
+
"check_for_update_on_startup = false"
|
|
1693
1699
|
].join("\n")] : [],
|
|
1694
1700
|
[
|
|
1695
1701
|
...unattended ? [] : ["# Written by apiary. Layered over your own config; deleted when the agent stops."],
|
|
@@ -1701,17 +1707,21 @@ function renderCodexProfile(mcpUrl, approvalMode = codexToolApprovalMode(), unat
|
|
|
1701
1707
|
...RUNTIME_TOOL_NAMES.map((tool) => [
|
|
1702
1708
|
`[mcp_servers.apiary.tools.${tool}]`,
|
|
1703
1709
|
`approval_mode = ${tomlString(approvalMode)}`
|
|
1704
|
-
].join("\n"))
|
|
1710
|
+
].join("\n")),
|
|
1711
|
+
...unattended ? [...new Set(trustDirs)].map((dir) => [
|
|
1712
|
+
`[projects.${tomlString(dir)}]`,
|
|
1713
|
+
'trust_level = "trusted"'
|
|
1714
|
+
].join("\n")) : []
|
|
1705
1715
|
];
|
|
1706
1716
|
return blocks.join("\n\n") + "\n";
|
|
1707
1717
|
}
|
|
1708
1718
|
function codexProfilePath(agentName, codexHome = userCodexHome()) {
|
|
1709
1719
|
return join6(codexHome, `${codexProfileName(agentName)}.config.toml`);
|
|
1710
1720
|
}
|
|
1711
|
-
function prepareCodexLaunch(agentName, mcpUrl, extraArgs = [], codexHome = userCodexHome()) {
|
|
1721
|
+
function prepareCodexLaunch(agentName, mcpUrl, extraArgs = [], codexHome = userCodexHome(), cwd = process.cwd()) {
|
|
1712
1722
|
mkdirSync2(codexHome, { recursive: true });
|
|
1713
1723
|
const profilePath = codexProfilePath(agentName, codexHome);
|
|
1714
|
-
writeFileSync3(profilePath, renderCodexProfile(mcpUrl), { mode: 384 });
|
|
1724
|
+
writeFileSync3(profilePath, renderCodexProfile(mcpUrl, void 0, void 0, trustDirsFor(cwd)), { mode: 384 });
|
|
1715
1725
|
const command = ["codex", "--profile", codexProfileName(agentName), ...extraArgs].join(" ");
|
|
1716
1726
|
return { command, profilePath };
|
|
1717
1727
|
}
|
|
@@ -1739,6 +1749,14 @@ function pruneCodexProfiles(liveAgentNames, codexHome = userCodexHome()) {
|
|
|
1739
1749
|
}
|
|
1740
1750
|
return removed;
|
|
1741
1751
|
}
|
|
1752
|
+
function trustDirsFor(cwd) {
|
|
1753
|
+
const dirs = [resolve2(cwd)];
|
|
1754
|
+
try {
|
|
1755
|
+
dirs.push(realpathSync2(cwd));
|
|
1756
|
+
} catch {
|
|
1757
|
+
}
|
|
1758
|
+
return [...new Set(dirs)];
|
|
1759
|
+
}
|
|
1742
1760
|
|
|
1743
1761
|
// src/cli/codex/run.ts
|
|
1744
1762
|
function listCodexSessions() {
|
|
@@ -1763,9 +1781,9 @@ async function runCodex(options) {
|
|
|
1763
1781
|
});
|
|
1764
1782
|
process.stderr.write(`MCP server: ${setup2.mcpServer.url}
|
|
1765
1783
|
`);
|
|
1766
|
-
await new Promise((
|
|
1767
|
-
process.on("SIGINT",
|
|
1768
|
-
process.on("SIGTERM",
|
|
1784
|
+
await new Promise((resolve4) => {
|
|
1785
|
+
process.on("SIGINT", resolve4);
|
|
1786
|
+
process.on("SIGTERM", resolve4);
|
|
1769
1787
|
});
|
|
1770
1788
|
await setup2.cleanup();
|
|
1771
1789
|
await eventLoopPromise2;
|
|
@@ -1867,9 +1885,9 @@ async function runCodex(options) {
|
|
|
1867
1885
|
const noop = (() => true);
|
|
1868
1886
|
process.stdout.write = noop;
|
|
1869
1887
|
process.stderr.write = noop;
|
|
1870
|
-
await new Promise((
|
|
1871
|
-
process.on("SIGTERM",
|
|
1872
|
-
process.on("SIGINT",
|
|
1888
|
+
await new Promise((resolve4) => {
|
|
1889
|
+
process.on("SIGTERM", resolve4);
|
|
1890
|
+
process.on("SIGINT", resolve4);
|
|
1873
1891
|
});
|
|
1874
1892
|
inviteAbort.abort();
|
|
1875
1893
|
await invitePromise;
|
|
@@ -1949,12 +1967,12 @@ function stopCodexSession(session) {
|
|
|
1949
1967
|
|
|
1950
1968
|
// src/cli/version.ts
|
|
1951
1969
|
import { readFileSync as readFileSync4 } from "fs";
|
|
1952
|
-
import { dirname, resolve as
|
|
1970
|
+
import { dirname, resolve as resolve3 } from "path";
|
|
1953
1971
|
import { fileURLToPath } from "url";
|
|
1954
1972
|
function readPackageField(field) {
|
|
1955
1973
|
try {
|
|
1956
1974
|
const dir = dirname(fileURLToPath(import.meta.url));
|
|
1957
|
-
const pkg = JSON.parse(readFileSync4(
|
|
1975
|
+
const pkg = JSON.parse(readFileSync4(resolve3(dir, "../../package.json"), "utf-8"));
|
|
1958
1976
|
return typeof pkg[field] === "string" ? pkg[field] : null;
|
|
1959
1977
|
} catch {
|
|
1960
1978
|
return null;
|
|
@@ -2137,7 +2155,7 @@ async function main() {
|
|
|
2137
2155
|
const all = rest.includes("--all");
|
|
2138
2156
|
const positional = rest.find((a) => !a.startsWith("--"));
|
|
2139
2157
|
const name = getFlag("name", rest) ?? positional;
|
|
2140
|
-
const { roomStop } = await import("../room-
|
|
2158
|
+
const { roomStop } = await import("../room-MAUAV2XD.js");
|
|
2141
2159
|
if (all) {
|
|
2142
2160
|
for (const r of listRoomSessions()) {
|
|
2143
2161
|
try {
|
|
@@ -2211,7 +2229,7 @@ async function main() {
|
|
|
2211
2229
|
if (sub === "create") {
|
|
2212
2230
|
const portStr = getFlag("port", roomArgs);
|
|
2213
2231
|
const port = portStr ? parseInt(portStr, 10) : void 0;
|
|
2214
|
-
const { roomCreate } = await import("../room-
|
|
2232
|
+
const { roomCreate } = await import("../room-MAUAV2XD.js");
|
|
2215
2233
|
await roomCreate({
|
|
2216
2234
|
room: getFlag("room", roomArgs) ?? roomArgs.find((a) => !a.startsWith("--")),
|
|
2217
2235
|
port,
|
|
@@ -2228,12 +2246,12 @@ async function main() {
|
|
|
2228
2246
|
console.error("Usage: apiary room resume <name>");
|
|
2229
2247
|
process.exit(1);
|
|
2230
2248
|
}
|
|
2231
|
-
const { roomResume } = await import("../room-
|
|
2249
|
+
const { roomResume } = await import("../room-MAUAV2XD.js");
|
|
2232
2250
|
await roomResume(name);
|
|
2233
2251
|
return;
|
|
2234
2252
|
}
|
|
2235
2253
|
if (sub === "list" || sub === "ls") {
|
|
2236
|
-
const { roomList } = await import("../room-
|
|
2254
|
+
const { roomList } = await import("../room-MAUAV2XD.js");
|
|
2237
2255
|
roomList();
|
|
2238
2256
|
return;
|
|
2239
2257
|
}
|
|
@@ -2243,7 +2261,7 @@ async function main() {
|
|
|
2243
2261
|
console.error("Usage: apiary room stop <name>");
|
|
2244
2262
|
process.exit(1);
|
|
2245
2263
|
}
|
|
2246
|
-
const { roomStop } = await import("../room-
|
|
2264
|
+
const { roomStop } = await import("../room-MAUAV2XD.js");
|
|
2247
2265
|
await roomStop(name);
|
|
2248
2266
|
return;
|
|
2249
2267
|
}
|
|
@@ -2258,7 +2276,7 @@ async function main() {
|
|
|
2258
2276
|
console.error(`Invalid port: ${portStr}`);
|
|
2259
2277
|
process.exit(1);
|
|
2260
2278
|
}
|
|
2261
|
-
const { spawnDaemonServer, isDaemonResult } = await import("../room-
|
|
2279
|
+
const { spawnDaemonServer, isDaemonResult } = await import("../room-MAUAV2XD.js");
|
|
2262
2280
|
const daemonRes = await spawnDaemonServer({
|
|
2263
2281
|
room: roomName,
|
|
2264
2282
|
port,
|
|
@@ -2300,11 +2318,11 @@ async function main() {
|
|
|
2300
2318
|
const name = getFlag("name", restArgs) ?? positionalName;
|
|
2301
2319
|
const pendingUrls = [...joinUrls];
|
|
2302
2320
|
if (name) {
|
|
2303
|
-
const { consumeInvite } = await import("../invites-
|
|
2321
|
+
const { consumeInvite } = await import("../invites-YZWCUC67.js");
|
|
2304
2322
|
const inviteUrl = consumeInvite(name);
|
|
2305
2323
|
if (inviteUrl) pendingUrls.push(inviteUrl);
|
|
2306
2324
|
}
|
|
2307
|
-
const { runMcpServer } = await import("../run-
|
|
2325
|
+
const { runMcpServer } = await import("../run-4EJB2KC3.js");
|
|
2308
2326
|
await runMcpServer({
|
|
2309
2327
|
joinUrls: pendingUrls.length > 0 ? pendingUrls : void 0,
|
|
2310
2328
|
name,
|