@rallycry/conveyor-agent 10.7.2 → 10.7.3

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.
@@ -1937,6 +1937,7 @@ async function restoreOnBoot(bundle, cwd) {
1937
1937
  import { z } from "zod";
1938
1938
  import { z as z2 } from "zod";
1939
1939
  var DEFAULT_SONNET_MODEL = "claude-sonnet-5";
1940
+ var FABLE_MODEL = "claude-fable-5";
1940
1941
  var TUI_KINDS = ["claude-code", "opencode"];
1941
1942
  var MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024;
1942
1943
  var EMBED_THRESHOLD_IMAGES = 5 * 1024 * 1024;
@@ -2502,7 +2503,7 @@ var ListMyLiveSessionsRequestSchema = z2.object({
2502
2503
  /** Admin-only: list another member's sessions instead of the caller's. */
2503
2504
  targetUserId: z2.string().optional()
2504
2505
  });
2505
- var ListActiveSessionUsersRequestSchema = z2.object({
2506
+ var ListProjectSessionGroupsRequestSchema = z2.object({
2506
2507
  projectId: z2.string()
2507
2508
  });
2508
2509
  var GetProjectAvailableTuisRequestSchema = z2.object({
@@ -4239,7 +4240,50 @@ function seedWorkspaceTrust(config, trustCwd) {
4239
4240
  config.projects = projects;
4240
4241
  return true;
4241
4242
  }
4242
- function planClaudeJsonSeed(existingRaw, trustCwd) {
4243
+ var FABLE_MODEL_OPTION = {
4244
+ value: `${FABLE_MODEL}[1m]`,
4245
+ label: "Fable",
4246
+ description: "Fable 5 - most capable for your hardest and longest-running tasks"
4247
+ };
4248
+ function seedFableModelOption(config) {
4249
+ const cache = Array.isArray(config.additionalModelOptionsCache) ? config.additionalModelOptionsCache : [];
4250
+ const hasFable = cache.some((entry) => {
4251
+ if (typeof entry !== "object" || entry === null) return false;
4252
+ const value = entry.value;
4253
+ return typeof value === "string" && value.toLowerCase().includes("fable");
4254
+ });
4255
+ if (hasFable) return false;
4256
+ config.additionalModelOptionsCache = [...cache, { ...FABLE_MODEL_OPTION }];
4257
+ return true;
4258
+ }
4259
+ function normalizeOauthIdentity(record) {
4260
+ const organizationUuid = typeof record.organizationUuid === "string" && record.organizationUuid !== "" ? record.organizationUuid : void 0;
4261
+ const accountUuid = typeof record.accountUuid === "string" && record.accountUuid !== "" ? record.accountUuid : void 0;
4262
+ if (!organizationUuid && !accountUuid) return null;
4263
+ return { organizationUuid, accountUuid };
4264
+ }
4265
+ function extractOauthIdentity(config) {
4266
+ return normalizeOauthIdentity(asRecord(config.oauthAccount));
4267
+ }
4268
+ function seedFableConsent(config, fallbackIdentity) {
4269
+ const identity = extractOauthIdentity(config) ?? fallbackIdentity;
4270
+ if (!identity) return false;
4271
+ const consent = asRecord(config.fableOverageConsentV2);
4272
+ let changed = false;
4273
+ const keys = [
4274
+ ...identity.organizationUuid ? [identity.organizationUuid] : [],
4275
+ ...identity.accountUuid ? [`acct:${identity.accountUuid}`] : []
4276
+ ];
4277
+ for (const key of keys) {
4278
+ if (consent[key] !== true) {
4279
+ consent[key] = true;
4280
+ changed = true;
4281
+ }
4282
+ }
4283
+ if (changed) config.fableOverageConsentV2 = consent;
4284
+ return changed;
4285
+ }
4286
+ function planClaudeJsonSeed(existingRaw, trustCwd, oauthIdentity) {
4243
4287
  const config = parseClaudeJson(existingRaw);
4244
4288
  const isFresh = Object.keys(config).length === 0;
4245
4289
  let changed = false;
@@ -4258,13 +4302,56 @@ function planClaudeJsonSeed(existingRaw, trustCwd) {
4258
4302
  if (trustCwd && seedWorkspaceTrust(config, trustCwd)) {
4259
4303
  changed = true;
4260
4304
  }
4305
+ if (seedFableModelOption(config)) {
4306
+ changed = true;
4307
+ }
4308
+ if (seedFableConsent(config, oauthIdentity ?? null)) {
4309
+ changed = true;
4310
+ }
4261
4311
  return changed ? JSON.stringify(config) : null;
4262
4312
  }
4313
+ function conveyorOauthMarkerPath() {
4314
+ return join3(claudeConfigHome(), "conveyor-oauth-account.json");
4315
+ }
4316
+ function parseOauthIdentity(raw) {
4317
+ if (!raw || raw.trim() === "") return null;
4318
+ try {
4319
+ return normalizeOauthIdentity(asRecord(JSON.parse(raw)));
4320
+ } catch {
4321
+ return null;
4322
+ }
4323
+ }
4324
+ async function persistOauthIdentityMarker(configIdentity, markerIdentity) {
4325
+ try {
4326
+ if (!configIdentity) return;
4327
+ if (markerIdentity !== null && markerIdentity.organizationUuid === configIdentity.organizationUuid && markerIdentity.accountUuid === configIdentity.accountUuid) {
4328
+ return;
4329
+ }
4330
+ await mkdir2(claudeConfigHome(), { recursive: true });
4331
+ const verified = await writeWithReadBackRetry(
4332
+ fsWriteIo(conveyorOauthMarkerPath()),
4333
+ JSON.stringify(configIdentity)
4334
+ );
4335
+ if (verified) {
4336
+ process.stderr.write("[conveyor-agent] persisted oauth identity marker for fable consent\n");
4337
+ }
4338
+ } catch (err) {
4339
+ const message = err instanceof Error ? err.message : String(err);
4340
+ process.stderr.write(`[conveyor-agent] oauth identity marker write failed: ${message}
4341
+ `);
4342
+ }
4343
+ }
4263
4344
  async function ensureClaudeOnboarding(env = process.env, trustCwd) {
4264
4345
  try {
4265
4346
  if (!isConveyorCloudEnv(env)) return;
4266
4347
  const path4 = claudeJsonPath();
4267
- const contents = planClaudeJsonSeed(await readRaw(path4), trustCwd);
4348
+ const existingRaw = await readRaw(path4);
4349
+ const markerIdentity = parseOauthIdentity(await readRaw(conveyorOauthMarkerPath()));
4350
+ await persistOauthIdentityMarker(
4351
+ extractOauthIdentity(parseClaudeJson(existingRaw)),
4352
+ markerIdentity
4353
+ );
4354
+ const contents = planClaudeJsonSeed(existingRaw, trustCwd, markerIdentity);
4268
4355
  if (contents === null) return;
4269
4356
  const verified = await writeWithReadBackRetry(fsWriteIo(path4), contents);
4270
4357
  if (verified) {
@@ -10998,4 +11085,4 @@ export {
10998
11085
  runStartCommand,
10999
11086
  unshallowRepo
11000
11087
  };
11001
- //# sourceMappingURL=chunk-DDDLYATP.js.map
11088
+ //# sourceMappingURL=chunk-UOHROQ6A.js.map