@rallycry/conveyor-agent 10.11.0 → 10.11.1

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.
@@ -2834,6 +2834,9 @@ var StartTaskAuditRequestSchema = z4.object({
2834
2834
  taskIds: z4.array(z4.string()).min(1).max(20),
2835
2835
  requestingUserId: z4.string().optional()
2836
2836
  });
2837
+ var GetActiveAuditSessionsRequestSchema = z4.object({
2838
+ projectId: z4.string()
2839
+ });
2837
2840
  var ReportTaskAuditResultRequestSchema = z4.object({
2838
2841
  projectId: z4.string(),
2839
2842
  taskId: z4.string(),
@@ -5417,9 +5420,52 @@ var PtySession = class {
5417
5420
  }
5418
5421
  };
5419
5422
 
5423
+ // src/harness/pty/config-home-health.ts
5424
+ import { mkdir as mkdir4 } from "fs/promises";
5425
+ import { homedir as homedir3 } from "os";
5426
+ import { join as join5 } from "path";
5427
+ var MOUNT_DISCONNECT_CODES = /* @__PURE__ */ new Set(["ENOTCONN", "EIO", "ESTALE", "ENXIO"]);
5428
+ var MOUNT_DISCONNECT_MESSAGES = [
5429
+ "socket is not connected",
5430
+ "transport endpoint is not connected"
5431
+ ];
5432
+ function isMountDisconnectError(err) {
5433
+ if (typeof err !== "object" || err === null) return false;
5434
+ const code = err.code;
5435
+ if (typeof code === "string" && MOUNT_DISCONNECT_CODES.has(code)) return true;
5436
+ const message = err.message;
5437
+ if (typeof message !== "string") return false;
5438
+ const lower = message.toLowerCase();
5439
+ return MOUNT_DISCONNECT_MESSAGES.some((needle) => lower.includes(needle));
5440
+ }
5441
+ function podLocalConfigHome() {
5442
+ return join5(homedir3(), ".claude-local");
5443
+ }
5444
+ async function ensureUsableClaudeConfigHome(cwd, log) {
5445
+ const configHome = claudeConfigHome();
5446
+ try {
5447
+ await mkdir4(join5(configHome, "projects", projectSlug(cwd)), { recursive: true });
5448
+ return { configHome, fellBack: false };
5449
+ } catch (err) {
5450
+ if (!isMountDisconnectError(err)) throw err;
5451
+ const fallback = podLocalConfigHome();
5452
+ log?.warn(
5453
+ "shared ~/.claude mount is unreachable; falling back to a pod-local config home. Session history will not persist across pods until the mount recovers.",
5454
+ {
5455
+ code: err.code ?? null,
5456
+ from: configHome,
5457
+ to: fallback
5458
+ }
5459
+ );
5460
+ process.env.CLAUDE_CONFIG_DIR = fallback;
5461
+ await mkdir4(join5(fallback, "projects", projectSlug(cwd)), { recursive: true });
5462
+ return { configHome: fallback, fellBack: true };
5463
+ }
5464
+ }
5465
+
5420
5466
  // src/harness/pty/index.ts
5421
5467
  var ENDED_GRACE_MS = 4e3;
5422
- var PtyHarness = class {
5468
+ var PtyHarness = class _PtyHarness {
5423
5469
  /**
5424
5470
  * `bridge` relays raw terminal I/O to/from the S2 server (and on to the S5
5425
5471
  * terminal). It is undefined for SDK-only callers and PTY runs that never
@@ -5431,6 +5477,7 @@ var PtyHarness = class {
5431
5477
  }
5432
5478
  bridge;
5433
5479
  adapter;
5480
+ static log = createServiceLogger("pty-harness");
5434
5481
  /** Fingerprint of the spawn-time options a reused process cannot change. */
5435
5482
  fingerprintOf(options) {
5436
5483
  return this.adapter.spawnFingerprint({
@@ -5473,6 +5520,9 @@ var PtyHarness = class {
5473
5520
  await stale.teardown();
5474
5521
  }
5475
5522
  session = new PtySession(opts.prompt, opts.options, want, this.bridge, this.adapter);
5523
+ if (this.adapter.capabilities.structuredEvents) {
5524
+ await ensureUsableClaudeConfigHome(opts.options.cwd, _PtyHarness.log);
5525
+ }
5476
5526
  await this.adapter.prepareEnvironment({ cwd: opts.options.cwd });
5477
5527
  session.onExit(() => this.handleSessionExit(session));
5478
5528
  await session.start();
@@ -7577,7 +7627,7 @@ function buildMutationTools(connection, config) {
7577
7627
 
7578
7628
  // src/tools/attachment-tools.ts
7579
7629
  import { readFile as readFile3, stat as stat4 } from "fs/promises";
7580
- import { basename, extname, isAbsolute, join as join5 } from "path";
7630
+ import { basename, extname, isAbsolute, join as join6 } from "path";
7581
7631
  import { z as z9 } from "zod";
7582
7632
  var IMAGE_MIME_BY_EXT = {
7583
7633
  ".png": "image/png",
@@ -7596,7 +7646,7 @@ function buildUploadAttachmentTool(connection, config) {
7596
7646
  },
7597
7647
  async ({ path: path4, title }) => {
7598
7648
  try {
7599
- const filePath = isAbsolute(path4) ? path4 : join5(config.workspaceDir, path4);
7649
+ const filePath = isAbsolute(path4) ? path4 : join6(config.workspaceDir, path4);
7600
7650
  const mimeType = IMAGE_MIME_BY_EXT[extname(filePath).toLowerCase()];
7601
7651
  if (!mimeType) {
7602
7652
  return textResult(
@@ -8309,7 +8359,7 @@ function createConveyorMcpServer(harness, connection, config, context, agentMode
8309
8359
 
8310
8360
  // src/harness/pty/adapters/types.ts
8311
8361
  import { accessSync, constants, statSync } from "fs";
8312
- import { join as join6 } from "path";
8362
+ import { join as join7 } from "path";
8313
8363
  var TuiUnavailableError = class extends Error {
8314
8364
  constructor(tui, message) {
8315
8365
  super(message);
@@ -8333,7 +8383,7 @@ function findOnPath(binary, env = process.env) {
8333
8383
  }
8334
8384
  for (const dir of (env.PATH ?? "").split(":")) {
8335
8385
  if (!dir) continue;
8336
- const candidate = join6(dir, binary);
8386
+ const candidate = join7(dir, binary);
8337
8387
  if (isExecutable(candidate)) return candidate;
8338
8388
  }
8339
8389
  return null;
@@ -10019,7 +10069,7 @@ var QueryBridge = class {
10019
10069
 
10020
10070
  // src/runner/session-runner-helpers.ts
10021
10071
  import { readFileSync as readFileSync2 } from "fs";
10022
- import { dirname as dirname2, join as join7 } from "path";
10072
+ import { dirname as dirname2, join as join8 } from "path";
10023
10073
  import { fileURLToPath as fileURLToPath2 } from "url";
10024
10074
  function mapChatHistory(messages) {
10025
10075
  if (!messages) return [];
@@ -10048,7 +10098,7 @@ function readAgentVersion() {
10048
10098
  const here = dirname2(fileURLToPath2(import.meta.url));
10049
10099
  for (const rel of ["../package.json", "../../package.json"]) {
10050
10100
  try {
10051
- const pkg = JSON.parse(readFileSync2(join7(here, rel), "utf-8"));
10101
+ const pkg = JSON.parse(readFileSync2(join8(here, rel), "utf-8"));
10052
10102
  if (pkg.version) return pkg.version;
10053
10103
  } catch {
10054
10104
  }
@@ -11521,12 +11571,12 @@ var SessionRunner = class _SessionRunner {
11521
11571
 
11522
11572
  // src/setup/config.ts
11523
11573
  import { readFile as readFile5 } from "fs/promises";
11524
- import { join as join8 } from "path";
11574
+ import { join as join9 } from "path";
11525
11575
  var DEVCONTAINER_PATH = ".devcontainer/conveyor/devcontainer.json";
11526
11576
  var DEVCONTAINER_PORT_DENY_LIST = /* @__PURE__ */ new Set([5432, 6379, 9200]);
11527
11577
  async function loadForwardPorts(workspaceDir) {
11528
11578
  try {
11529
- const raw = await readFile5(join8(workspaceDir, DEVCONTAINER_PATH), "utf-8");
11579
+ const raw = await readFile5(join9(workspaceDir, DEVCONTAINER_PATH), "utf-8");
11530
11580
  const parsed = JSON.parse(raw);
11531
11581
  const ports = (parsed.forwardPorts ?? []).filter(
11532
11582
  (p) => typeof p === "number" && !DEVCONTAINER_PORT_DENY_LIST.has(p)
@@ -11708,8 +11758,8 @@ export {
11708
11758
  inheritedEnv,
11709
11759
  buildPromptBytes,
11710
11760
  ClaudeTuiAdapter,
11711
- PtyHarness,
11712
11761
  createServiceLogger,
11762
+ PtyHarness,
11713
11763
  textResult,
11714
11764
  GIT_TIMEOUT_MS,
11715
11765
  hasUncommittedChanges,
@@ -11742,4 +11792,4 @@ export {
11742
11792
  runStartCommand,
11743
11793
  unshallowRepo
11744
11794
  };
11745
- //# sourceMappingURL=chunk-KEKGEDN2.js.map
11795
+ //# sourceMappingURL=chunk-N7CLCSZR.js.map