@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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startWorkbenchServer
3
- } from "./chunk-F7XHSNU7.js";
3
+ } from "./chunk-ATYCG6MT.js";
4
4
  import {
5
5
  TOMBSTONE_MESSAGE,
6
6
  isLegacyEntrypointLaunch
@@ -12,7 +12,7 @@ import {
12
12
  refreshSkillsAfterCheckout,
13
13
  runPreReadyBinds
14
14
  } from "./chunk-V5WR2F2P.js";
15
- import "./chunk-EKTPDG3G.js";
15
+ import "./chunk-SXZS2R52.js";
16
16
  import {
17
17
  GitPrepJob,
18
18
  defaultGit,
@@ -491,11 +491,15 @@ async function superviseRunner(opts) {
491
491
  // src/boot/user-home.ts
492
492
  import {
493
493
  chmodSync,
494
+ closeSync,
494
495
  copyFileSync,
495
496
  existsSync,
497
+ fsyncSync,
496
498
  lstatSync,
497
499
  mkdirSync,
500
+ openSync,
498
501
  readFileSync,
502
+ readlinkSync,
499
503
  readdirSync,
500
504
  rmSync,
501
505
  statSync as statSync2,
@@ -645,7 +649,10 @@ function seedClaudeJson(targetPath) {
645
649
  let merged = config ? deepMerge(config, SEED_GATES) : { ...SEED_GATES, theme: "dark" };
646
650
  const cache = Array.isArray(merged.additionalModelOptionsCache) ? merged.additionalModelOptionsCache : [];
647
651
  if (!hasFableEntry(cache)) {
648
- merged = { ...merged, additionalModelOptionsCache: [...cache, SEED_FABLE_OPTION] };
652
+ merged = {
653
+ ...merged,
654
+ additionalModelOptionsCache: [...cache, SEED_FABLE_OPTION]
655
+ };
649
656
  }
650
657
  writeFileSync2(targetPath, JSON.stringify(merged));
651
658
  } catch {
@@ -787,12 +794,60 @@ function wireUserHome(opts) {
787
794
  "mkdir agent scratch dir",
788
795
  () => mkdirSync(opts.scratchDir ?? "/tmp/claude-cmd", { recursive: true })
789
796
  );
797
+ if (opts.required && (!userId || !projectId || !isDir(userHomeMount))) {
798
+ throw new Error("Required persistent user home is unavailable or missing claim identity");
799
+ }
790
800
  if (userId && projectId && isDir(userHomeMount)) {
791
- return wireMountedUserHome({ home, userHomeMount, userId, projectId, sharedDir, log });
801
+ if (opts.required) assertHomeWritable(join3(userHomeMount, "users", userId, projectId));
802
+ const repair = wireMountedUserHome({
803
+ home,
804
+ userHomeMount,
805
+ userId,
806
+ projectId,
807
+ sharedDir,
808
+ log
809
+ });
810
+ if (opts.required) assertHomeLinks(opts, userId, projectId);
811
+ return repair;
792
812
  }
793
813
  wireNoMountUserHome({ home, sharedDir, log });
794
814
  return Promise.resolve();
795
815
  }
816
+ function assertHomeWritable(root) {
817
+ mkdirSync(root, { recursive: true });
818
+ const probe = join3(root, `.home-ready-${process.pid}-${crypto.randomUUID()}`);
819
+ const fd = openSync(probe, "wx", 384);
820
+ try {
821
+ fsyncSync(fd);
822
+ } finally {
823
+ closeSync(fd);
824
+ rmSync(probe);
825
+ }
826
+ }
827
+ function assertHomeLinks(opts, userId, projectId) {
828
+ const root = join3(opts.userHomeMount, "users", userId, projectId);
829
+ for (const relative of [
830
+ ".claude",
831
+ ".config/claude",
832
+ ".conveyor-codex",
833
+ ".local/share/opencode",
834
+ ".config/opencode"
835
+ ]) {
836
+ const link = join3(opts.home, relative);
837
+ if (!lstatSync(link).isSymbolicLink() || readlinkSync(link) !== join3(root, relative)) {
838
+ throw new Error(`Required persistent user home link ${relative} was not wired`);
839
+ }
840
+ }
841
+ const memory = join3(root, ".claude", "projects", AGENT_MEMORY_PROJECT_DIR, "memory");
842
+ if (readlinkSync(memory) !== join3(opts.userHomeMount, "users", "_shared", "memory", projectId)) {
843
+ throw new Error("Required persistent shared memory was not wired");
844
+ }
845
+ const credentials = join3(root, ".claude", ".credentials.json");
846
+ const podLocal = opts.sharedDir ? join3(opts.sharedDir, "claude-credentials.pod.json") : join3(opts.home, ".claude-credentials.pod.json");
847
+ if (readlinkSync(credentials) !== podLocal || !isRegularFile(join3(opts.home, ".claude.json"))) {
848
+ throw new Error("Required persistent home must keep credentials and CLI config pod-local");
849
+ }
850
+ }
796
851
  var RECLAIM_FIND_TIMEOUT_MS = 1e4;
797
852
  async function reclaimHomeOwnership(home, exec, log) {
798
853
  for (const dir of [join3(home, ".config"), join3(home, ".local")]) {
@@ -824,7 +879,7 @@ async function reclaimHomeOwnership(home, exec, log) {
824
879
  }
825
880
 
826
881
  // src/boot/sshd.ts
827
- import { chmodSync as chmodSync2, closeSync, copyFileSync as copyFileSync2, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync } from "fs";
882
+ import { chmodSync as chmodSync2, closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync as openSync2 } from "fs";
828
883
  import { join as join4 } from "path";
829
884
  function persistedAuthorizedKeys() {
830
885
  return join4(
@@ -843,7 +898,7 @@ async function startWorkspaceSshd(exec, log, port = process.env.CONVEYOR_WORKSPA
843
898
  if (existsSync2(persisted)) {
844
899
  copyFileSync2(persisted, authorizedKeys);
845
900
  } else if (!existsSync2(authorizedKeys)) {
846
- closeSync(openSync(authorizedKeys, "a"));
901
+ closeSync2(openSync2(authorizedKeys, "a"));
847
902
  }
848
903
  chmodSync2(authorizedKeys, 384);
849
904
  } catch (err) {
@@ -919,6 +974,7 @@ function defaultWorkbenchBootDeps() {
919
974
  void wireUserHome({
920
975
  home: HOME_DIR,
921
976
  userHomeMount: USER_HOME_MOUNT,
977
+ required: process.env.CONVEYOR_USER_HOME_REQUIRED === "1",
922
978
  userId: ctx.childEnv?.CONVEYOR_USER_ID,
923
979
  projectId: ctx.childEnv?.CONVEYOR_PROJECT_ID ?? ctx.childEnv?.PROJECT_ID,
924
980
  sharedDir: process.env.CONVEYOR_SHARED_DIR,
@@ -944,7 +1000,10 @@ function warnErr(ctx, label) {
944
1000
  };
945
1001
  }
946
1002
  async function runWorkbenchBoot(ctx, overrides = {}) {
947
- const deps = { ...defaultWorkbenchBootDeps(), ...overrides };
1003
+ const deps = {
1004
+ ...defaultWorkbenchBootDeps(),
1005
+ ...overrides
1006
+ };
948
1007
  const bundle = await deps.pollBundle(ctx);
949
1008
  if (!bundle) {
950
1009
  ctx.log.info("[boot] standby poll aborted \u2014 parking for shutdown");
@@ -952,6 +1011,8 @@ async function runWorkbenchBoot(ctx, overrides = {}) {
952
1011
  }
953
1012
  ctx.bundle = bundle;
954
1013
  ctx.childEnv = deps.unpack(ctx, bundle);
1014
+ const requiredHome = process.env.CONVEYOR_USER_HOME_REQUIRED === "1";
1015
+ if (requiredHome) deps.wireHome(ctx);
955
1016
  const job = new GitPrepJob(deps.gitPrepDeps(ctx, bundle), {
956
1017
  // Order pinned by the old entrypoint-grimoire test: binds BEFORE the
957
1018
  // ready flip (Claude must not spawn before skills exist), references after.
@@ -978,10 +1039,12 @@ async function runWorkbenchBoot(ctx, overrides = {}) {
978
1039
  warnErr(ctx, "ensureWorkspaceDir")(err);
979
1040
  }
980
1041
  job.start();
981
- try {
982
- deps.wireHome(ctx);
983
- } catch (err) {
984
- warnErr(ctx, "wireUserHome")(err);
1042
+ if (!requiredHome) {
1043
+ try {
1044
+ deps.wireHome(ctx);
1045
+ } catch (err) {
1046
+ warnErr(ctx, "wireUserHome")(err);
1047
+ }
985
1048
  }
986
1049
  void deps.startSshd(ctx).catch(warnErr(ctx, "startWorkspaceSshd"));
987
1050
  void deps.reclaimOwnership(ctx).catch(warnErr(ctx, "reclaimHomeOwnership"));
@@ -1079,6 +1142,7 @@ function agentBootSteps(deps = defaultBootDeps(), signal = new AbortController()
1079
1142
  void wireUserHome({
1080
1143
  home: HOME_DIR2,
1081
1144
  userHomeMount: USER_HOME_MOUNT2,
1145
+ required: process.env.CONVEYOR_USER_HOME_REQUIRED === "1",
1082
1146
  userId: ctx.childEnv?.CONVEYOR_USER_ID,
1083
1147
  projectId: ctx.childEnv?.CONVEYOR_PROJECT_ID ?? ctx.childEnv?.PROJECT_ID,
1084
1148
  sharedDir: process.env.CONVEYOR_SHARED_DIR,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadPtySpawn
3
- } from "./chunk-EKTPDG3G.js";
3
+ } from "./chunk-SXZS2R52.js";
4
4
  import {
5
5
  terminateProcessGroup
6
6
  } from "./chunk-W4LZ7R6Z.js";
@@ -8,7 +8,7 @@ import {
8
8
  readWorkspaceBytes,
9
9
  statWorkspacePath,
10
10
  workspacePathExists
11
- } from "./chunk-KXB55NJP.js";
11
+ } from "./chunk-O3MXZHIS.js";
12
12
  import {
13
13
  reportBootMilestone
14
14
  } from "./chunk-VIUZS7V4.js";
@@ -1371,7 +1371,7 @@ ${q.question}${q.options.length ? "\n" + q.options.map((o) => `- ${o.label}: ${o
1371
1371
  }
1372
1372
  };
1373
1373
 
1374
- // ../shared/dist/chunk-DXAS5XD4.js
1374
+ // ../shared/dist/chunk-DUZLPI2K.js
1375
1375
  import { z } from "zod";
1376
1376
  import { z as z2 } from "zod";
1377
1377
  var DEFAULT_SONNET_MODEL = "claude-sonnet-5-5";
@@ -1476,7 +1476,10 @@ var actionsPrebakeRegistrySchema = z.string().trim().min(1).regex(
1476
1476
  function uniqueSortedArray(item, minimum = 0) {
1477
1477
  return z.array(item).min(minimum).superRefine((values, ctx) => {
1478
1478
  if (new Set(values).size !== values.length) {
1479
- ctx.addIssue({ code: z.ZodIssueCode.custom, message: "Duplicate values are not allowed" });
1479
+ ctx.addIssue({
1480
+ code: z.ZodIssueCode.custom,
1481
+ message: "Duplicate values are not allowed"
1482
+ });
1480
1483
  }
1481
1484
  }).transform((values) => [...values].sort());
1482
1485
  }
@@ -2627,6 +2630,13 @@ var ListProjectTasksRequestSchema = z7.object({
2627
2630
  }).refine((p) => !(p.unassigned && p.assigneeId), {
2628
2631
  message: "Pass either assigneeId or unassigned, not both"
2629
2632
  });
2633
+ var ListCardStatesRequestSchema = z7.object({
2634
+ projectId: z7.string(),
2635
+ statuses: z7.array(z7.string()).min(1).max(32),
2636
+ types: z7.array(z7.string()).optional(),
2637
+ cursor: z7.string().nullable().optional(),
2638
+ limit: z7.number().int().positive().optional().default(500)
2639
+ });
2630
2640
  var GetProjectTaskRequestSchema = z7.object({
2631
2641
  projectId: z7.string(),
2632
2642
  taskId: z7.string()
@@ -3639,6 +3649,15 @@ function formatEvaluateQuestionsResult(res) {
3639
3649
  );
3640
3650
  return JSON.stringify({ model: res.model, results });
3641
3651
  }
3652
+ function subProjectScopePaths(subProject) {
3653
+ return [
3654
+ ...new Set(
3655
+ [subProject.rootPath, ...subProject.additionalAllowedPaths ?? []].filter(
3656
+ (path) => !!path
3657
+ )
3658
+ )
3659
+ ];
3660
+ }
3642
3661
  var MEETING_CHECKLIST_TITLE_MAX = 300;
3643
3662
  var MEETING_TRANSCRIPT_MAX_CHARS = 2e6;
3644
3663
  var MEETING_TITLE_MAX = 200;
@@ -5346,6 +5365,7 @@ export {
5346
5365
  TAG_REASON_MAX,
5347
5366
  CRITICAL_AUTOMATED_SOURCES,
5348
5367
  formatEvaluateQuestionsResult,
5368
+ subProjectScopePaths,
5349
5369
  AGENT_STATUS_REASON_USER_QUESTION,
5350
5370
  TASK_CHAT_HISTORY_LIMIT,
5351
5371
  PM_CHAT_HISTORY_LIMIT,