@rallycry/conveyor-agent 11.0.47 → 11.0.49
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/dist/{boot-ZPXDDZDF.js → boot-GD5XMLPS.js} +75 -11
- package/dist/{chunk-F7XHSNU7.js → chunk-ATYCG6MT.js} +1 -1
- package/dist/{chunk-4A6GCJGG.js → chunk-K35YJK2U.js} +1 -1
- package/dist/{chunk-KXB55NJP.js → chunk-O3MXZHIS.js} +22 -2
- package/dist/{chunk-7Y3IY5QQ.js → chunk-RNE3JAF5.js} +337 -254
- package/dist/{chunk-EKTPDG3G.js → chunk-SXZS2R52.js} +27 -2
- package/dist/cli.js +21 -47
- package/dist/index.js +3 -3
- package/dist/{serve-boot-TPZ6CPCQ.js → serve-boot-4QBD4LW4.js} +2 -2
- package/dist/{server-GJZKUVBE.js → server-FPDS4CT5.js} +2 -2
- package/package.json +2 -2
|
@@ -46,9 +46,32 @@ function spawnOptionsFingerprint(input) {
|
|
|
46
46
|
if (input.effort) parts.push(input.effort);
|
|
47
47
|
return JSON.stringify(parts);
|
|
48
48
|
}
|
|
49
|
-
var
|
|
49
|
+
var ESC = String.fromCharCode(27);
|
|
50
|
+
var ANSI_CSI = new RegExp(`${ESC}\\[([0-9;?]*)([ -/]*)([@-~])`, "g");
|
|
51
|
+
var ANSI_OSC = new RegExp(`${ESC}\\][^\\u0007${ESC}]*(?:\\u0007|${ESC}\\\\)`, "g");
|
|
52
|
+
var MAX_CURSOR_FORWARD = 300;
|
|
53
|
+
function flattenTerminalText(raw) {
|
|
54
|
+
return raw.replace(ANSI_OSC, "").replace(ANSI_CSI, (_seq, params, inter, final) => {
|
|
55
|
+
if (inter || params.startsWith("?")) return "";
|
|
56
|
+
switch (final) {
|
|
57
|
+
case "C":
|
|
58
|
+
return " ".repeat(Math.min(Math.max(Number(params) || 1, 1), MAX_CURSOR_FORWARD));
|
|
59
|
+
case "G":
|
|
60
|
+
return " ";
|
|
61
|
+
case "A":
|
|
62
|
+
case "B":
|
|
63
|
+
case "E":
|
|
64
|
+
case "F":
|
|
65
|
+
case "H":
|
|
66
|
+
case "f":
|
|
67
|
+
return "\n";
|
|
68
|
+
default:
|
|
69
|
+
return "";
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
50
73
|
function cleanTerminalOutput(raw, maxChars = 1200) {
|
|
51
|
-
const noAnsi = raw
|
|
74
|
+
const noAnsi = flattenTerminalText(raw);
|
|
52
75
|
let out = "";
|
|
53
76
|
for (const ch of noAnsi) {
|
|
54
77
|
const code = ch.charCodeAt(0);
|
|
@@ -215,6 +238,7 @@ function inheritedEnv(socketPath) {
|
|
|
215
238
|
if (env.CLAUDE_CODE_OAUTH_TOKEN) {
|
|
216
239
|
delete env.ANTHROPIC_API_KEY;
|
|
217
240
|
}
|
|
241
|
+
delete env.CONVEYOR_CLAUDE_OAUTH;
|
|
218
242
|
if (ghHostsManagedByConveyor() && env.CONVEYOR_KEEP_GH_TOKEN_ENV !== "1") {
|
|
219
243
|
delete env.GH_TOKEN;
|
|
220
244
|
delete env.GITHUB_TOKEN;
|
|
@@ -272,6 +296,7 @@ export {
|
|
|
272
296
|
resolveClaudeBinary,
|
|
273
297
|
buildSpawnArgs,
|
|
274
298
|
spawnOptionsFingerprint,
|
|
299
|
+
flattenTerminalText,
|
|
275
300
|
cleanTerminalOutput,
|
|
276
301
|
buildExitErrors,
|
|
277
302
|
MAX_DIAGNOSTIC_OUTPUT,
|
package/dist/cli.js
CHANGED
|
@@ -7,33 +7,30 @@ import {
|
|
|
7
7
|
WorkspaceCommandSupervisor,
|
|
8
8
|
startWorkspaceCommandsAfterConnect,
|
|
9
9
|
stopWorkspaceCommands
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-K35YJK2U.js";
|
|
11
11
|
import {
|
|
12
12
|
PtyHarness,
|
|
13
13
|
SessionRunner,
|
|
14
14
|
buildProjectTools,
|
|
15
15
|
buildRateLimitEvents,
|
|
16
|
-
buildSynthesizedCredentials,
|
|
17
16
|
buildUnmeasurableEvent,
|
|
18
|
-
claudeJsonPath,
|
|
19
17
|
getEffortOverride,
|
|
20
18
|
getModelOverride,
|
|
21
19
|
isPermissionDeniedError,
|
|
22
20
|
parseUsageGauges,
|
|
21
|
+
probeUsageIsolated,
|
|
23
22
|
resolvePlaywrightMcpServer,
|
|
24
23
|
resolveSessionStart,
|
|
25
24
|
resolveTuiAdapter,
|
|
26
25
|
resolveTuiKindFromEnv,
|
|
27
|
-
runUsageProbe,
|
|
28
26
|
sampleKeyUsage,
|
|
29
27
|
usesNativeUsageReporting
|
|
30
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-RNE3JAF5.js";
|
|
31
29
|
import "./chunk-V5WR2F2P.js";
|
|
32
30
|
import {
|
|
33
31
|
inheritedEnv,
|
|
34
|
-
resolvePtySpawn
|
|
35
|
-
|
|
36
|
-
} from "./chunk-EKTPDG3G.js";
|
|
32
|
+
resolvePtySpawn
|
|
33
|
+
} from "./chunk-SXZS2R52.js";
|
|
37
34
|
import {
|
|
38
35
|
AgentConnection,
|
|
39
36
|
DEFAULT_LIFECYCLE_CONFIG,
|
|
@@ -44,7 +41,7 @@ import {
|
|
|
44
41
|
createServiceLogger,
|
|
45
42
|
loadAndAnnotateDiscoveredPorts,
|
|
46
43
|
loadConveyorConfig
|
|
47
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-O3MXZHIS.js";
|
|
48
45
|
import "./chunk-VIUZS7V4.js";
|
|
49
46
|
import "./chunk-W4LZ7R6Z.js";
|
|
50
47
|
import "./chunk-372R6E4C.js";
|
|
@@ -55,7 +52,7 @@ import "./chunk-6Q6LQBWO.js";
|
|
|
55
52
|
|
|
56
53
|
// src/cli.ts
|
|
57
54
|
import { readFileSync } from "fs";
|
|
58
|
-
import { join
|
|
55
|
+
import { join, dirname } from "path";
|
|
59
56
|
import { fileURLToPath } from "url";
|
|
60
57
|
|
|
61
58
|
// src/utils/session-identity.ts
|
|
@@ -238,10 +235,10 @@ var ProjectSessionRunner = class {
|
|
|
238
235
|
async sampleAndReportKeyUsage() {
|
|
239
236
|
if (this.stopped || usesNativeUsageReporting()) return;
|
|
240
237
|
const codingAgentKeyId = process.env.CONVEYOR_CODING_AGENT_KEY_ID;
|
|
241
|
-
const { samples, unmeasurable } = await sampleKeyUsage(
|
|
242
|
-
process.env.CLAUDE_CODE_OAUTH_TOKEN,
|
|
243
|
-
|
|
244
|
-
);
|
|
238
|
+
const { samples, unmeasurable } = await sampleKeyUsage({
|
|
239
|
+
token: process.env.CLAUDE_CODE_OAUTH_TOKEN,
|
|
240
|
+
cwd: this.config.workspaceDir
|
|
241
|
+
});
|
|
245
242
|
if (unmeasurable) {
|
|
246
243
|
this.connection.sendEvent(buildUnmeasurableEvent(unmeasurable.reason, codingAgentKeyId));
|
|
247
244
|
return;
|
|
@@ -259,8 +256,6 @@ var ProjectSessionRunner = class {
|
|
|
259
256
|
};
|
|
260
257
|
|
|
261
258
|
// src/usage/multi-key-probe.ts
|
|
262
|
-
import { mkdtemp, writeFile, copyFile, rm } from "fs/promises";
|
|
263
|
-
import { join } from "path";
|
|
264
259
|
var logger = createServiceLogger("multi-key-probe");
|
|
265
260
|
function gaugesToSamples(stdout) {
|
|
266
261
|
const { sessionUsage, weeklyUsage, sessionResetsAt, weeklyResetsAt, gauges } = parseUsageGauges(stdout);
|
|
@@ -285,30 +280,9 @@ function gaugesToSamples(stdout) {
|
|
|
285
280
|
}
|
|
286
281
|
return samples;
|
|
287
282
|
}
|
|
288
|
-
async function isolatedProbe(token, now, cwd) {
|
|
289
|
-
let dir = null;
|
|
290
|
-
try {
|
|
291
|
-
dir = await mkdtemp(join(sessionTempBase(), "conveyor-usage-"));
|
|
292
|
-
await writeFile(join(dir, ".credentials.json"), buildSynthesizedCredentials(token, now), {
|
|
293
|
-
encoding: "utf8",
|
|
294
|
-
mode: 384
|
|
295
|
-
});
|
|
296
|
-
await copyFile(claudeJsonPath(), join(dir, ".claude.json")).catch(() => {
|
|
297
|
-
});
|
|
298
|
-
return await runUsageProbe({ cwd, env: { ...process.env, CLAUDE_CONFIG_DIR: dir } });
|
|
299
|
-
} catch (error) {
|
|
300
|
-
logger.info("isolated usage probe failed", {
|
|
301
|
-
error: error instanceof Error ? error.message : String(error)
|
|
302
|
-
});
|
|
303
|
-
return "";
|
|
304
|
-
} finally {
|
|
305
|
-
if (dir) await rm(dir, { recursive: true, force: true }).catch(() => {
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
283
|
async function probeKeysUsage(keys, deps = {}) {
|
|
310
284
|
const now = deps.now ?? Date.now;
|
|
311
|
-
const probeOne = deps.probeOne ?? ((token) =>
|
|
285
|
+
const probeOne = deps.probeOne ?? ((token) => probeUsageIsolated(token, { now: now(), cwd: deps.cwd }));
|
|
312
286
|
const results = [];
|
|
313
287
|
for (const key of keys) {
|
|
314
288
|
if (!key.oauthToken) continue;
|
|
@@ -582,10 +556,10 @@ var AdhocSessionRunner = class {
|
|
|
582
556
|
async sampleAndReportOwnKey() {
|
|
583
557
|
if (this.stopped || usesNativeUsageReporting()) return;
|
|
584
558
|
const codingAgentKeyId = process.env.CONVEYOR_CODING_AGENT_KEY_ID;
|
|
585
|
-
const { samples, unmeasurable } = await sampleKeyUsage(
|
|
586
|
-
process.env.CLAUDE_CODE_OAUTH_TOKEN,
|
|
587
|
-
|
|
588
|
-
);
|
|
559
|
+
const { samples, unmeasurable } = await sampleKeyUsage({
|
|
560
|
+
token: process.env.CLAUDE_CODE_OAUTH_TOKEN,
|
|
561
|
+
cwd: this.config.workspaceDir
|
|
562
|
+
});
|
|
589
563
|
if (unmeasurable) {
|
|
590
564
|
this.connection.sendEvent(buildUnmeasurableEvent(unmeasurable.reason, codingAgentKeyId));
|
|
591
565
|
return;
|
|
@@ -1212,7 +1186,7 @@ function wireSpawnChildren(mode, connection, supervisors, logger7) {
|
|
|
1212
1186
|
|
|
1213
1187
|
// src/cli.ts
|
|
1214
1188
|
if (process.argv[2] === "boot") {
|
|
1215
|
-
const { runBoot } = await import("./boot-
|
|
1189
|
+
const { runBoot } = await import("./boot-GD5XMLPS.js");
|
|
1216
1190
|
process.exit(await runBoot(process.argv.slice(3)));
|
|
1217
1191
|
}
|
|
1218
1192
|
if (isLegacyEntrypointLaunch(process.env)) {
|
|
@@ -1222,7 +1196,7 @@ if (isLegacyEntrypointLaunch(process.env)) {
|
|
|
1222
1196
|
}
|
|
1223
1197
|
if (process.argv.includes("--version")) {
|
|
1224
1198
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
1225
|
-
const pkgPath =
|
|
1199
|
+
const pkgPath = join(__dirname, "..", "package.json");
|
|
1226
1200
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
1227
1201
|
process.stdout.write(pkg.version + "\n");
|
|
1228
1202
|
process.exit(0);
|
|
@@ -1281,7 +1255,7 @@ process.on("unhandledRejection", (reason) => {
|
|
|
1281
1255
|
process.exit(1);
|
|
1282
1256
|
});
|
|
1283
1257
|
if (process.env.CONVEYOR_MODE === "workbench") {
|
|
1284
|
-
const { startWorkbenchServer } = await import("./server-
|
|
1258
|
+
const { startWorkbenchServer } = await import("./server-FPDS4CT5.js");
|
|
1285
1259
|
const { oomWatchdogOptionsFromEnv } = await import("./oom-watchdog-PAC5OJJG.js");
|
|
1286
1260
|
const { DEFAULT_WORKBENCH_PORT } = await import("./protocol-QBCYO4GI.js");
|
|
1287
1261
|
const port = Number(process.env.CONVEYOR_WORKBENCH_PORT) || DEFAULT_WORKBENCH_PORT;
|
|
@@ -1291,7 +1265,7 @@ if (process.env.CONVEYOR_MODE === "workbench") {
|
|
|
1291
1265
|
process.exit(1);
|
|
1292
1266
|
}
|
|
1293
1267
|
const pkgDir = dirname(fileURLToPath(import.meta.url));
|
|
1294
|
-
const pkg = JSON.parse(readFileSync(
|
|
1268
|
+
const pkg = JSON.parse(readFileSync(join(pkgDir, "..", "package.json"), "utf-8"));
|
|
1295
1269
|
const handle = await startWorkbenchServer({
|
|
1296
1270
|
port,
|
|
1297
1271
|
token,
|
|
@@ -1423,7 +1397,7 @@ if (!RUNNER_MODES.includes(CONVEYOR_MODE)) {
|
|
|
1423
1397
|
process.exit(1);
|
|
1424
1398
|
}
|
|
1425
1399
|
if (CONVEYOR_MODE === "serving") {
|
|
1426
|
-
const { runServingSession } = await import("./serve-boot-
|
|
1400
|
+
const { runServingSession } = await import("./serve-boot-4QBD4LW4.js");
|
|
1427
1401
|
exitContext.runnerMode = "serving";
|
|
1428
1402
|
exitContext.sessionId = process.env.CONVEYOR_SESSION_ID ?? exitContext.sessionId;
|
|
1429
1403
|
const outcome = await runServingSession({
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionRunner,
|
|
3
3
|
unshallowRepo
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RNE3JAF5.js";
|
|
5
5
|
import "./chunk-V5WR2F2P.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-SXZS2R52.js";
|
|
7
7
|
import {
|
|
8
8
|
AgentConnection,
|
|
9
9
|
GIT_TIMEOUT_MS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
stageAndCommit,
|
|
18
18
|
updateRemoteToken,
|
|
19
19
|
workspacePathExists
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-O3MXZHIS.js";
|
|
21
21
|
import "./chunk-VIUZS7V4.js";
|
|
22
22
|
import {
|
|
23
23
|
runAuthTokenCommand,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkspaceCommandSupervisor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K35YJK2U.js";
|
|
4
4
|
import {
|
|
5
5
|
AgentConnection,
|
|
6
6
|
DEFAULT_LIFECYCLE_CONFIG,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ensureOnTaskBranch,
|
|
12
12
|
loadAndAnnotateDiscoveredPorts,
|
|
13
13
|
loadConveyorConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-O3MXZHIS.js";
|
|
15
15
|
import "./chunk-VIUZS7V4.js";
|
|
16
16
|
import "./chunk-W4LZ7R6Z.js";
|
|
17
17
|
import "./chunk-IA45XHOA.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rallycry/conveyor-agent",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.49",
|
|
4
4
|
"description": "Conveyor Agent Runner v10 - PTY harness for the task chat (SDK harness for audit/project-chat). Agent-as-User architecture with BaseService patterns. Works locally too.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test:watch": "vitest",
|
|
35
35
|
"lint": "oxlint -c ../../.oxlintrc.json src",
|
|
36
36
|
"lint:fix": "oxlint -c ../../.oxlintrc.json --fix src",
|
|
37
|
-
"typecheck": "
|
|
37
|
+
"typecheck": "bash ../../scripts/typecheck.sh"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@anthropic-ai/claude-agent-sdk": "^0.3.284",
|