@rallycry/conveyor-agent 10.6.0 → 10.6.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.
@@ -2308,6 +2308,9 @@ var SpawnTaskSessionRequestSchema = z.object({
2308
2308
  taskId: z.string(),
2309
2309
  kind: z.enum(["tui", "shell"])
2310
2310
  });
2311
+ var SpawnTaskReviewRequestSchema = z.object({
2312
+ taskId: z.string()
2313
+ });
2311
2314
  var ReportSessionSpawnFailureRequestSchema = z.object({
2312
2315
  sessionId: z.string(),
2313
2316
  spawnedSessionId: z.string(),
@@ -4117,11 +4120,16 @@ async function readRaw(path4) {
4117
4120
  }
4118
4121
  }
4119
4122
  async function ensureClaudeCredentials(env = process.env) {
4123
+ const isCloud = isConveyorCloudEnv(env);
4124
+ const token = env.CLAUDE_CODE_OAUTH_TOKEN;
4125
+ if (isCloud && token) {
4126
+ await sanitizeApprovedApiKeys(token);
4127
+ }
4120
4128
  try {
4121
4129
  const path4 = claudeCredentialsPath();
4122
4130
  const plan = planCredentialsWrite({
4123
- isCloud: isConveyorCloudEnv(env),
4124
- token: env.CLAUDE_CODE_OAUTH_TOKEN,
4131
+ isCloud,
4132
+ token,
4125
4133
  existingRaw: await readRaw(path4),
4126
4134
  now: Date.now()
4127
4135
  });
@@ -4136,6 +4144,40 @@ async function ensureClaudeCredentials(env = process.env) {
4136
4144
  `);
4137
4145
  }
4138
4146
  }
4147
+ function apiKeyApprovalSuffix(token) {
4148
+ return token.slice(-20);
4149
+ }
4150
+ function planApprovedApiKeyCleanup(existingRaw, oauthToken) {
4151
+ if (!oauthToken) return null;
4152
+ const config = parseClaudeJson(existingRaw);
4153
+ const responses = config.customApiKeyResponses;
4154
+ if (typeof responses !== "object" || responses === null || Array.isArray(responses)) {
4155
+ return null;
4156
+ }
4157
+ const record = responses;
4158
+ const approved = record.approved;
4159
+ if (!Array.isArray(approved)) return null;
4160
+ const suffix = apiKeyApprovalSuffix(oauthToken);
4161
+ const filtered = approved.filter((entry) => entry !== suffix);
4162
+ if (filtered.length === approved.length) return null;
4163
+ record.approved = filtered;
4164
+ return JSON.stringify(config);
4165
+ }
4166
+ async function sanitizeApprovedApiKeys(oauthToken) {
4167
+ try {
4168
+ const path4 = claudeJsonPath();
4169
+ const cleaned = planApprovedApiKeyCleanup(await readRaw(path4), oauthToken);
4170
+ if (cleaned === null) return;
4171
+ await writeFile4(path4, cleaned, "utf8");
4172
+ process.stderr.write(
4173
+ "[conveyor-agent] removed poisoned customApiKeyResponses.approved entry from .claude.json\n"
4174
+ );
4175
+ } catch (err) {
4176
+ const message = err instanceof Error ? err.message : String(err);
4177
+ process.stderr.write(`[conveyor-agent] claude approved-key sanitize failed: ${message}
4178
+ `);
4179
+ }
4180
+ }
4139
4181
  function claudeJsonPath() {
4140
4182
  const configDir = process.env.CLAUDE_CONFIG_DIR;
4141
4183
  return configDir ? join3(configDir, ".claude.json") : join3(homedir2(), ".claude.json");
@@ -4255,7 +4297,10 @@ function resolvePlanDialogTiming() {
4255
4297
  return {
4256
4298
  firstPressMs: envMs("CONVEYOR_PTY_PLAN_DIALOG_FIRST_PRESS_MS", PLAN_DIALOG_FIRST_PRESS_MS),
4257
4299
  intervalMs: envMs("CONVEYOR_PTY_PLAN_DIALOG_INTERVAL_MS", PLAN_DIALOG_INTERVAL_MS),
4258
- slowIntervalMs: envMs("CONVEYOR_PTY_PLAN_DIALOG_SLOW_INTERVAL_MS", PLAN_DIALOG_SLOW_INTERVAL_MS),
4300
+ slowIntervalMs: envMs(
4301
+ "CONVEYOR_PTY_PLAN_DIALOG_SLOW_INTERVAL_MS",
4302
+ PLAN_DIALOG_SLOW_INTERVAL_MS
4303
+ ),
4259
4304
  fastWindowMs: envMs("CONVEYOR_PTY_PLAN_DIALOG_FAST_WINDOW_MS", PLAN_DIALOG_FAST_WINDOW_MS),
4260
4305
  windowMs: envMs("CONVEYOR_PTY_PLAN_DIALOG_WINDOW_MS", PLAN_DIALOG_WINDOW_MS)
4261
4306
  };
@@ -4289,6 +4334,9 @@ function inheritedEnv(socketPath) {
4289
4334
  for (const [key, value] of Object.entries(process.env)) {
4290
4335
  if (typeof value === "string") env[key] = value;
4291
4336
  }
4337
+ if (env.CLAUDE_CODE_OAUTH_TOKEN) {
4338
+ delete env.ANTHROPIC_API_KEY;
4339
+ }
4292
4340
  if (socketPath) {
4293
4341
  env.CONVEYOR_HOOK_SOCKET = socketPath;
4294
4342
  }
@@ -11149,4 +11197,4 @@ export {
11149
11197
  runStartCommand,
11150
11198
  unshallowRepo
11151
11199
  };
11152
- //# sourceMappingURL=chunk-5FRDOFI4.js.map
11200
+ //# sourceMappingURL=chunk-5ELLQUP4.js.map