cc-pets 2.5.0 → 2.6.0-beta.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.
Files changed (92) hide show
  1. package/CC_BRIDGE.md +47 -5
  2. package/CC_BRIDGE.zh-CN.md +42 -5
  3. package/CONTRIBUTING.md +1 -1
  4. package/CONTRIBUTING.zh-CN.md +1 -1
  5. package/README.md +48 -19
  6. package/README.zh-CN.md +46 -17
  7. package/Resources/AgentIcons/antigravity.icns +0 -0
  8. package/Resources/zh-Hans.lproj/Localizable.strings +64 -15
  9. package/Sources/CCPets/App/CCPetsAppDelegate+AgentEvents.m +7 -3
  10. package/Sources/CCPets/App/CCPetsAppDelegate+AgentStatus.m +11 -3
  11. package/Sources/CCPets/App/CCPetsAppDelegate+Bridge.m +16 -5
  12. package/Sources/CCPets/App/CCPetsAppDelegate+Private.h +11 -1
  13. package/Sources/CCPets/App/CCPetsAppDelegate+Profiles.m +21 -11
  14. package/Sources/CCPets/App/CCPetsAppDelegate+Quota.m +27 -16
  15. package/Sources/CCPets/App/CCPetsAppDelegate+Settings.m +43 -7
  16. package/Sources/CCPets/App/CCPetsAppDelegate+Speech.m +2 -1
  17. package/Sources/CCPets/App/CCPetsAppDelegate+Update.m +3 -3
  18. package/Sources/CCPets/App/CCPetsAppDelegate+Workbench.m +20 -22
  19. package/Sources/CCPets/App/CCPetsAppDelegate.m +14 -6
  20. package/Sources/CCPets/App/CCPetsVersion.h +4 -0
  21. package/Sources/CCPets/App/CCPetsVersion.m +34 -0
  22. package/Sources/CCPets/App/main.m +11 -0
  23. package/Sources/CCPets/Bridge/CCPetsBridge.m +7 -5
  24. package/Sources/CCPets/Bridge/CCPetsBridgeAntigravityApp.h +4 -0
  25. package/Sources/CCPets/Bridge/CCPetsBridgeAntigravityApp.m +119 -0
  26. package/Sources/CCPets/Bridge/CCPetsBridgeCLI.h +3 -1
  27. package/Sources/CCPets/Bridge/CCPetsBridgeCLI.m +172 -17
  28. package/Sources/CCPets/Bridge/CCPetsBridgeCore.m +25 -7
  29. package/Sources/CCPets/Bridge/CCPetsBridgeSetup.m +17 -0
  30. package/Sources/CCPets/Bridge/CCPetsBridgeStore.h +7 -2
  31. package/Sources/CCPets/Bridge/CCPetsBridgeStore.m +92 -11
  32. package/Sources/CCPets/Bridge/CCPetsBridgeTerminalTitle.h +12 -0
  33. package/Sources/CCPets/Bridge/CCPetsBridgeTerminalTitle.m +105 -0
  34. package/Sources/CCPets/Integrations/CCPetsAntigravityConfig.h +17 -0
  35. package/Sources/CCPets/Integrations/CCPetsAntigravityConfig.m +462 -0
  36. package/Sources/CCPets/Integrations/CCPetsAntigravityEvents.h +5 -0
  37. package/Sources/CCPets/Integrations/CCPetsAntigravityEvents.m +180 -0
  38. package/Sources/CCPets/Integrations/CCPetsBridgeTitleRelay.h +3 -0
  39. package/Sources/CCPets/Integrations/CCPetsBridgeTitleRelay.m +463 -0
  40. package/Sources/CCPets/Integrations/CCPetsIntegrations.h +1 -1
  41. package/Sources/CCPets/Integrations/CCPetsIntegrations.m +37 -7
  42. package/Sources/CCPets/Integrations/CCPetsLaunchPreflight.m +15 -5
  43. package/Sources/CCPets/Integrations/CCPetsProfiles.h +2 -1
  44. package/Sources/CCPets/Integrations/CCPetsProfiles.m +112 -81
  45. package/Sources/CCPets/Integrations/CCPetsTerminalFocus.h +5 -1
  46. package/Sources/CCPets/Integrations/CCPetsTerminalFocus.m +163 -40
  47. package/Sources/CCPets/Pet/CCPetsPreviews.m +16 -8
  48. package/Sources/CCPets/Pet/PetView+Menu.m +56 -5
  49. package/Sources/CCPets/Support/CCPetsDoctor.m +126 -37
  50. package/Sources/CCPets/Support/CCPetsPaths.h +5 -0
  51. package/Sources/CCPets/Support/CCPetsPaths.m +15 -0
  52. package/Sources/CCPets/Support/CCPetsPreferences.h +4 -1
  53. package/Sources/CCPets/Support/CCPetsPreferences.m +18 -0
  54. package/Sources/CCPets/UI/CCPetsMenuBarPanel.m +10 -5
  55. package/Sources/CCPets/UI/CCPetsMenuBarSummary.m +9 -6
  56. package/Sources/CCPets/UI/CCPetsSettingsPage.h +3 -0
  57. package/Sources/CCPets/UI/CCPetsSettingsPage.m +189 -8
  58. package/Sources/CCPets/UI/CCPetsUIStyle.m +3 -1
  59. package/Sources/CCPets/UI/CCPetsUsagePage.h +4 -3
  60. package/Sources/CCPets/UI/CCPetsUsagePage.m +69 -43
  61. package/Sources/CCPets/UI/CCPetsUsageStore.m +11 -1
  62. package/Sources/CCPets/UI/CCPetsWorkbenchPages.m +1 -1
  63. package/Sources/CCPets/Usage/CCPetsAntigravityQuota.m +115 -0
  64. package/Sources/CCPets/Usage/CCPetsNormalizedUsage.h +5 -0
  65. package/Sources/CCPets/Usage/CCPetsNormalizedUsage.m +43 -0
  66. package/Sources/CCPets/Usage/CCPetsProviderRegistry+Testing.h +13 -0
  67. package/Sources/CCPets/Usage/CCPetsProviderRegistry.h +25 -0
  68. package/Sources/CCPets/Usage/CCPetsProviderRegistry.m +94 -0
  69. package/Sources/CCPets/Usage/CCPetsQuotaHistory.h +1 -1
  70. package/Sources/CCPets/Usage/CCPetsQuotaHistory.m +11 -8
  71. package/Sources/CCPets/Usage/CCPetsUsage+Internal.h +2 -0
  72. package/Sources/CCPets/Usage/CCPetsUsage+Models.m +206 -14
  73. package/Sources/CCPets/Usage/CCPetsUsage+TokenTotals.m +4 -4
  74. package/Sources/CCPets/Usage/CCPetsUsage.h +7 -2
  75. package/Sources/CCPets/Usage/CCPetsUsageMode.h +2 -0
  76. package/Sources/CCPets/Usage/CCPetsUsageMode.m +29 -4
  77. package/Sources/CCPets/Usage/CCPetsUsageMonitor.h +4 -4
  78. package/Sources/CCPets/Usage/CCPetsUsageMonitor.m +90 -7
  79. package/Sources/CCPets/Usage/QuotaDashboardView+CompactRow.m +81 -0
  80. package/Sources/CCPets/Usage/QuotaDashboardView+Primitives.m +5 -8
  81. package/Sources/CCPets/Usage/QuotaDashboardView+Private.h +26 -4
  82. package/Sources/CCPets/Usage/QuotaDashboardView+Rendering.m +99 -99
  83. package/Sources/CCPets/Usage/QuotaDashboardView.h +9 -10
  84. package/Sources/CCPets/Usage/QuotaDashboardView.m +232 -79
  85. package/THIRD_PARTY_NOTICES.md +5 -4
  86. package/THIRD_PARTY_NOTICES.zh-CN.md +6 -5
  87. package/bin/agy-with-pet +82 -0
  88. package/bin/cc-pets +1 -1
  89. package/bin/claude-with-pet +15 -0
  90. package/bin/codex-with-pet +17 -2
  91. package/package.json +5 -3
  92. package/scripts/install-shell-integration.sh +5 -0
@@ -1,4 +1,5 @@
1
1
  #import "CCPetsProfiles.h"
2
+ #import "CCPetsAntigravityConfig.h"
2
3
  #import "CCPetsBridge.h"
3
4
  #import "CCPetsBridgeSetup.h"
4
5
  #import "CCPetsCLISupport.h"
@@ -9,6 +10,7 @@
9
10
 
10
11
  NSString *const CCPetsProfileProviderClaude = @"claude";
11
12
  NSString *const CCPetsProfileProviderCodex = @"codex";
13
+ NSString *const CCPetsProfileProviderAntigravity = @"antigravity";
12
14
  NSNotificationName const CCPetsProfilesDidChangeNotification = @"CCPetsProfilesDidChange";
13
15
  NSString *const CCPetsProfileStateIntegrated = @"integrated";
14
16
  NSString *const CCPetsProfileStateRepair = @"repair";
@@ -23,8 +25,14 @@ NSString *CCPetsProfilesPath(void) {
23
25
  }
24
26
 
25
27
  static BOOL ValidProvider(NSString *provider) {
26
- return [provider isEqualToString:CCPetsProfileProviderClaude] ||
27
- [provider isEqualToString:CCPetsProfileProviderCodex];
28
+ return [provider isKindOfClass:NSString.class] &&
29
+ [@[CCPetsProfileProviderClaude, CCPetsProfileProviderCodex, CCPetsProfileProviderAntigravity] containsObject:provider];
30
+ }
31
+
32
+ static NSString *OfficialHome(NSString *provider) {
33
+ if (!ValidProvider(provider)) return nil;
34
+ NSString *leaf = [provider isEqualToString:CCPetsProfileProviderAntigravity] ? @"gemini" : provider;
35
+ return [CCPetsHomeDirectory() stringByAppendingPathComponent:[@"." stringByAppendingString:leaf]];
28
36
  }
29
37
 
30
38
  static NSString *CanonicalHome(NSString *home) {
@@ -80,11 +88,7 @@ NSString *CCPetsProfileDefaultDisplayName(NSString *provider, NSString *home) {
80
88
  }
81
89
 
82
90
  BOOL CCPetsProfileIsOfficialDefault(NSDictionary *profile) {
83
- NSString *provider = profile[@"provider"];
84
- NSString *leaf = [provider isEqualToString:CCPetsProfileProviderClaude] ? @".claude"
85
- : ([provider isEqualToString:CCPetsProfileProviderCodex] ? @".codex" : nil);
86
- if (!leaf) return NO;
87
- NSString *official = CanonicalHome([CCPetsHomeDirectory() stringByAppendingPathComponent:leaf]);
91
+ NSString *official = CanonicalHome(OfficialHome(profile[@"provider"]));
88
92
  return official.length > 0 && [CanonicalHome(profile[@"home"]) isEqualToString:official];
89
93
  }
90
94
 
@@ -113,6 +117,11 @@ static BOOL HomeContainsAny(NSString *home, NSArray<NSString *> *names) {
113
117
 
114
118
  BOOL CCPetsProfileHomeMatchesProvider(NSString *provider, NSString *home) {
115
119
  if (!ValidProvider(provider) || home.length == 0) return NO;
120
+ if ([provider isEqualToString:CCPetsProfileProviderAntigravity]) {
121
+ return CCPetsDirectoryExists([home stringByAppendingPathComponent:@"antigravity-cli"]) ||
122
+ ([CanonicalHome(home) isEqual:CanonicalHome(OfficialHome(provider))] &&
123
+ CCPetsDirectoryExists([home stringByAppendingPathComponent:@"antigravity"]));
124
+ }
116
125
  NSString *other = [provider isEqualToString:CCPetsProfileProviderClaude]
117
126
  ? CCPetsProfileProviderCodex : CCPetsProfileProviderClaude;
118
127
  return HomeContainsAny(home, ProfileHomeMarkers(provider)) &&
@@ -203,7 +212,7 @@ NSDictionary *CCPetsProfileForHome(NSString *provider, NSString *home) {
203
212
  NSDictionary *CCPetsRegisterProfile(NSString *provider, NSString *home,
204
213
  NSString *displayName, NSString *existingID, NSString **errorMessage) {
205
214
  if (!ValidProvider(provider)) {
206
- if (errorMessage) *errorMessage = @"Provider must be claude or codex.";
215
+ if (errorMessage) *errorMessage = L(@"Provider must be claude, codex, or antigravity.");
207
216
  return nil;
208
217
  }
209
218
  NSString *canonical = CanonicalHome(home);
@@ -212,6 +221,11 @@ NSDictionary *CCPetsRegisterProfile(NSString *provider, NSString *home,
212
221
  if (errorMessage) *errorMessage = [NSString stringWithFormat:@"Profile Home is not a directory: %@", home ?: @""];
213
222
  return nil;
214
223
  }
224
+ if ([provider isEqualToString:CCPetsProfileProviderAntigravity] &&
225
+ !CCPetsProfileHomeMatchesProvider(provider, canonical)) {
226
+ if (errorMessage) *errorMessage = L(@"Choose a Gemini root folder containing the antigravity-cli directory.");
227
+ return nil;
228
+ }
215
229
  NSString *profileID = existingID.length > 0 ? existingID : CCPetsProfileID(provider, canonical);
216
230
  NSString *slug = CCPetsProfileSlug(canonical);
217
231
  NSString *name = [displayName stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
@@ -287,17 +301,22 @@ NSDictionary *CCPetsProfileStatus(NSDictionary *profile) {
287
301
  BOOL available = CCPetsDirectoryExists(home);
288
302
  if (!available) return @{@"state": CCPetsProfileStateUnavailable, @"available": @NO,
289
303
  @"petHooks": @NO, @"bridge": @NO};
290
- NSString *config = [home stringByAppendingPathComponent:
291
- [provider isEqualToString:CCPetsProfileProviderClaude] ? @"settings.json" : @"hooks.json"];
292
- NSString *petMarker = [provider isEqualToString:CCPetsProfileProviderClaude]
293
- ? CCPetsClaudeHookMarker : CCPetsCodexHookMarker;
294
- NSString *configText = [NSString stringWithContentsOfFile:config
295
- encoding:NSUTF8StringEncoding error:nil] ?: @"";
296
- NSString *profileID = [profile[@"id"] isKindOfClass:NSString.class] ? profile[@"id"] : @"";
297
- BOOL petHooks = [configText containsString:petMarker] &&
298
- (profileID.length == 0 || [configText containsString:profileID]);
299
- BOOL bridge = [configText containsString:CCBridgeHookMarker] &&
300
- (profileID.length == 0 || [configText containsString:profileID]);
304
+ BOOL petHooks, bridge;
305
+ if ([provider isEqualToString:CCPetsProfileProviderAntigravity]) {
306
+ petHooks = CCPetsAntigravityPetHooksInstalled(profile);
307
+ bridge = CCPetsAntigravityBridgeInstalled(profile);
308
+ } else {
309
+ BOOL claude = [provider isEqualToString:CCPetsProfileProviderClaude];
310
+ NSString *config = [home stringByAppendingPathComponent:claude ? @"settings.json" : @"hooks.json"];
311
+ NSString *petMarker = claude ? CCPetsClaudeHookMarker : CCPetsCodexHookMarker;
312
+ NSString *configText = [NSString stringWithContentsOfFile:config
313
+ encoding:NSUTF8StringEncoding error:nil] ?: @"";
314
+ NSString *profileID = [profile[@"id"] isKindOfClass:NSString.class] ? profile[@"id"] : @"";
315
+ petHooks = [configText containsString:petMarker] &&
316
+ (profileID.length == 0 || [configText containsString:profileID]);
317
+ bridge = [configText containsString:CCBridgeHookMarker] &&
318
+ (profileID.length == 0 || [configText containsString:profileID]);
319
+ }
301
320
  BOOL bridgeExpected = CCBridgeEnabled();
302
321
  BOOL healthy = petHooks && (!bridgeExpected || bridge) && ![profile[@"needsRepair"] boolValue];
303
322
  return @{@"state": healthy ? CCPetsProfileStateIntegrated : CCPetsProfileStateRepair,
@@ -326,32 +345,36 @@ BOOL CCPetsMigrateManagedDefaultProfiles(NSString **errorMessage) {
326
345
  if (CCPetsProfileForHome(candidate[@"provider"], home)) continue;
327
346
  if (!CCPetsRegisterProfile(candidate[@"provider"], home, nil, nil, errorMessage)) return NO;
328
347
  }
348
+ NSString *home = OfficialHome(CCPetsProfileProviderAntigravity);
349
+ NSDictionary *antigravity = @{@"provider": CCPetsProfileProviderAntigravity, @"home": home,
350
+ @"id": CCPetsProfileID(CCPetsProfileProviderAntigravity, home)};
351
+ if (!CCPetsProfileForHome(CCPetsProfileProviderAntigravity, home) &&
352
+ CCPetsAntigravityPetHooksInstalled(antigravity)) {
353
+ return CCPetsRegisterProfile(CCPetsProfileProviderAntigravity, home, nil, nil, errorMessage) != nil;
354
+ }
329
355
  return YES;
330
356
  }
331
357
 
332
358
  BOOL CCPetsEnsureOfficialDefaultProfiles(NSString **errorMessage) {
333
- NSArray<NSDictionary *> *candidates = @[
334
- @{ @"provider": CCPetsProfileProviderClaude,
335
- @"home": [CCPetsHomeDirectory() stringByAppendingPathComponent:@".claude"] },
336
- @{ @"provider": CCPetsProfileProviderCodex,
337
- @"home": [CCPetsHomeDirectory() stringByAppendingPathComponent:@".codex"] }
338
- ];
339
- for (NSDictionary *candidate in candidates) {
340
- NSString *provider = candidate[@"provider"];
341
- NSString *home = candidate[@"home"];
359
+ for (NSString *provider in @[CCPetsProfileProviderClaude, CCPetsProfileProviderCodex, CCPetsProfileProviderAntigravity]) {
360
+ NSString *home = OfficialHome(provider);
342
361
  if (CCPetsProfileForHome(provider, home)) continue;
343
- BOOL isDirectory = NO;
344
- BOOL homeExists = [NSFileManager.defaultManager fileExistsAtPath:home isDirectory:&isDirectory] && isDirectory;
345
- BOOL cliInstalled = [provider isEqualToString:CCPetsProfileProviderClaude]
346
- ? CCPetsClaudeCLIInstalled() : CCPetsCodexCLIInstalled();
362
+ BOOL antigravity = [provider isEqualToString:CCPetsProfileProviderAntigravity];
363
+ NSString *dataHome = antigravity ? [home stringByAppendingPathComponent:@"antigravity-cli"] : home;
347
364
  // 官方 Home 是唯一允许自动发现的目录:已有目录直接登记;CLI 已安装但首次尚未
348
365
  // 生成目录时创建它。其他任何相似目录都只能由用户从菜单手动添加。
349
- if (!homeExists && !cliInstalled) continue;
350
- NSError *directoryError = nil;
351
- if (!homeExists && ![NSFileManager.defaultManager createDirectoryAtPath:home
352
- withIntermediateDirectories:YES attributes:nil error:&directoryError]) {
353
- if (errorMessage) *errorMessage = directoryError.localizedDescription;
354
- return NO;
366
+ if (!CCPetsDirectoryExists(dataHome) && !(antigravity && CCPetsProfileHomeMatchesProvider(provider, home))) {
367
+ BOOL cliInstalled;
368
+ if (antigravity) cliInstalled = CCPetsFindRealExecutable(@"agy", @"AGY_REAL_BIN") != nil;
369
+ else if ([provider isEqualToString:CCPetsProfileProviderClaude]) cliInstalled = CCPetsClaudeCLIInstalled();
370
+ else cliInstalled = CCPetsCodexCLIInstalled();
371
+ if (!cliInstalled) continue;
372
+ NSError *directoryError = nil;
373
+ if (![NSFileManager.defaultManager createDirectoryAtPath:dataHome
374
+ withIntermediateDirectories:YES attributes:nil error:&directoryError]) {
375
+ if (errorMessage) *errorMessage = directoryError.localizedDescription;
376
+ return NO;
377
+ }
355
378
  }
356
379
  if (!CCPetsRegisterProfile(provider, home, nil, nil, errorMessage)) return NO;
357
380
  }
@@ -363,38 +386,55 @@ static NSString *ValueAfter(NSArray<NSString *> *arguments, NSString *flag) {
363
386
  return index != NSNotFound && index + 1 < arguments.count ? arguments[index + 1] : nil;
364
387
  }
365
388
 
366
- static int AdaptProfile(NSDictionary *profile) {
389
+ static BOOL PrintReport(NSArray<NSString *> *report) {
390
+ BOOL succeeded = YES;
391
+ for (NSString *line in report) {
392
+ BOOL failed = [line hasPrefix:@"ERROR: "];
393
+ CCPetsPrintLine(failed ? stderr : stdout, line);
394
+ if (failed) succeeded = NO;
395
+ }
396
+ return succeeded;
397
+ }
398
+
399
+ static int InstallProfileHooks(NSDictionary *profile) {
367
400
  NSString *provider = profile[@"provider"], *home = profile[@"home"];
368
- CCPetsPrintLine(stdout, @"stage=hooks");
369
- int status = [provider isEqualToString:CCPetsProfileProviderClaude]
370
- ? InstallClaudeHooksAtHome(CCPetsExecutablePath(), home)
371
- : InstallCodexHooksAtHome(CCPetsExecutablePath(), home);
372
- if (status != 0) {
373
- CCPetsSetProfileNeedsRepair(profile[@"id"], YES, NULL);
374
- return status;
401
+ if ([provider isEqualToString:CCPetsProfileProviderAntigravity]) {
402
+ return PrintReport(CCPetsInstallAntigravityPetHooks(profile)) ? 0 : 1;
375
403
  }
376
- if (CCBridgeEnabled()) {
377
- CCPetsPrintLine(stdout, @"stage=bridge");
378
- NSArray<NSString *> *report = nil;
379
- @try {
380
- report = CCBridgeInstallForProfile(profile, CCBridgeOptions(), YES);
381
- } @catch (NSException *exception) {
382
- CCPetsSetProfileNeedsRepair(profile[@"id"], YES, NULL);
383
- @throw;
384
- }
385
- BOOL bridgeFailed = NO;
386
- for (NSString *line in report) {
387
- CCPetsPrintLine([line hasPrefix:@"ERROR: "] ? stderr : stdout, line);
388
- if ([line hasPrefix:@"ERROR: "]) bridgeFailed = YES;
389
- }
390
- if (bridgeFailed) {
391
- CCPetsSetProfileNeedsRepair(profile[@"id"], YES, NULL);
392
- return 1;
404
+ if ([provider isEqualToString:CCPetsProfileProviderClaude]) {
405
+ return InstallClaudeHooksAtHome(CCPetsExecutablePath(), home);
406
+ }
407
+ return InstallCodexHooksAtHome(CCPetsExecutablePath(), home);
408
+ }
409
+
410
+ static int UninstallProfileHooks(NSDictionary *profile) {
411
+ NSString *provider = profile[@"provider"], *home = profile[@"home"];
412
+ if ([provider isEqualToString:CCPetsProfileProviderAntigravity]) {
413
+ BOOL installed = CCPetsAntigravityPetHooksInstalled(profile);
414
+ if (!CCPetsRemoveAntigravityPetHooks(profile)) return 1;
415
+ if (installed) CCPetsPrintLine(stdout, [NSString stringWithFormat:L(@"Removed the CC Pets hooks in %@."), home]);
416
+ return 0;
417
+ }
418
+ if ([provider isEqualToString:CCPetsProfileProviderClaude]) return UninstallClaudeHooksAtHome(home);
419
+ return UninstallCodexHooksAtHome(home);
420
+ }
421
+
422
+ static int AdaptProfile(NSDictionary *profile) {
423
+ CCPetsPrintLine(stdout, @"stage=hooks");
424
+ int status;
425
+ @try {
426
+ status = InstallProfileHooks(profile);
427
+ if (status == 0 && CCBridgeEnabled()) {
428
+ CCPetsPrintLine(stdout, @"stage=bridge");
429
+ if (!PrintReport(CCBridgeInstallForProfile(profile, CCBridgeOptions(), YES))) status = 1;
393
430
  }
431
+ } @catch (NSException *exception) {
432
+ CCPetsSetProfileNeedsRepair(profile[@"id"], YES, NULL);
433
+ @throw;
394
434
  }
395
- CCPetsPrintLine(stdout, @"stage=verify");
396
- CCPetsSetProfileNeedsRepair(profile[@"id"], NO, NULL);
397
- return 0;
435
+ if (status == 0) CCPetsPrintLine(stdout, @"stage=verify");
436
+ CCPetsSetProfileNeedsRepair(profile[@"id"], status != 0, NULL);
437
+ return status;
398
438
  }
399
439
 
400
440
  int CCPetsProfileCommandMain(NSArray<NSString *> *arguments) {
@@ -468,12 +508,9 @@ int CCPetsProfileCommandMain(NSArray<NSString *> *arguments) {
468
508
  int status = AdaptProfile(profile);
469
509
  if (status != 0) return status;
470
510
  if (![oldProfile[@"home"] isEqualToString:profile[@"home"]]) {
471
- for (NSString *line in CCBridgeUninstallForProfile(oldProfile, CCBridgeShouldTouchMCP())) {
472
- CCPetsPrintLine(stdout, line);
473
- }
474
- status = [oldProfile[@"provider"] isEqualToString:CCPetsProfileProviderClaude]
475
- ? UninstallClaudeHooksAtHome(oldProfile[@"home"])
476
- : UninstallCodexHooksAtHome(oldProfile[@"home"]);
511
+ BOOL bridgeRemoved = PrintReport(CCBridgeUninstallForProfile(oldProfile, CCBridgeShouldTouchMCP()));
512
+ status = UninstallProfileHooks(oldProfile);
513
+ if (!bridgeRemoved && status == 0) status = 1;
477
514
  }
478
515
  return status;
479
516
  }
@@ -481,16 +518,10 @@ int CCPetsProfileCommandMain(NSArray<NSString *> *arguments) {
481
518
  NSString *profileID = ValueAfter(arguments, @"--id");
482
519
  NSDictionary *profile = CCPetsProfileWithID(profileID);
483
520
  if (!profile) { CCPetsPrintLine(stderr, @"Profile not found."); return 1; }
484
- BOOL bridgeFailed = NO;
485
- for (NSString *line in CCBridgeUninstallForProfile(profile, CCBridgeShouldTouchMCP())) {
486
- CCPetsPrintLine([line hasPrefix:@"ERROR: "] ? stderr : stdout, line);
487
- if ([line hasPrefix:@"ERROR: "]) bridgeFailed = YES;
488
- }
489
- int status = [profile[@"provider"] isEqualToString:CCPetsProfileProviderClaude]
490
- ? UninstallClaudeHooksAtHome(profile[@"home"])
491
- : UninstallCodexHooksAtHome(profile[@"home"]);
521
+ BOOL bridgeRemoved = PrintReport(CCBridgeUninstallForProfile(profile, CCBridgeShouldTouchMCP()));
522
+ int status = UninstallProfileHooks(profile);
492
523
  if (status != 0) return status;
493
- if (bridgeFailed) {
524
+ if (!bridgeRemoved) {
494
525
  CCPetsSetProfileNeedsRepair(profileID, YES, NULL);
495
526
  return 1;
496
527
  }
@@ -9,6 +9,10 @@ BOOL TerminalFocusRunsUnderSharedAgentHost(void);
9
9
  BOOL IsCodexDesktopFocusTarget(NSDictionary *target);
10
10
  BOOL CodexDesktopFocusTargetIsLive(NSDictionary *target, NSTimeInterval eventTime);
11
11
  BOOL CodexDesktopApplicationIsRunning(void);
12
+ BOOL AntigravityDesktopApplicationIsRunning(void);
13
+ // Antigravity App 会话的回跳目标只有 bundleID,没有 TTY。
14
+ extern NSString *const CCPetsAntigravityAppBundleIdentifier;
15
+ BOOL IsAntigravityDesktopFocusTarget(NSDictionary *target);
12
16
  // 只读本地聊天索引;YES 为已持久化聊天,NO 为未收录/已归档,nil 为无法确认。
13
17
  NSNumber *CodexPersistentThreadStatus(NSString *thread, NSString *codexHome);
14
18
 
@@ -17,10 +21,10 @@ NSNumber *CodexPersistentThreadStatus(NSString *thread, NSString *codexHome);
17
21
  NSDictionary *TerminalFocusTargetForHook(NSDictionary *payload, NSString *provider);
18
22
  // cc-pets --codex-launch:codex-with-pet 在 exec 真正的 codex 之前登记自己的终端。
19
23
  int RegisterCodexLaunch(void);
20
- // 以下两个供测试直接驱动。
21
24
  BOOL RegisterCodexLaunchForProcess(pid_t pid, NSString *cwd, NSDictionary *terminal,
22
25
  NSTimeInterval launchedAt);
23
26
  NSDictionary *CodexLaunchTerminalForThread(NSString *thread, NSDictionary *payload);
27
+ BOOL CodexHasTerminalTitleLaunch(NSString *cwd);
24
28
 
25
29
  // Terminal / iTerm2 / Ghostty 按 TTY 精确选择;JetBrains IDE 和 VS Code 家族通过插件/扩展
26
30
  // 异步聚焦。YES 表示已执行或已交给插件处理,其他终端在无扩展模式下激活应用。
@@ -4,6 +4,7 @@
4
4
  #import "CCPetsIDEIntegration.h"
5
5
  #import "CCPetsVSCodeIntegration.h"
6
6
  #import <fcntl.h>
7
+ #import <limits.h>
7
8
  #import <sys/file.h>
8
9
  #import <sys/sysctl.h>
9
10
  #import <sys/stat.h>
@@ -39,6 +40,24 @@ BOOL CodexDesktopApplicationIsRunning(void) {
39
40
  return NO;
40
41
  }
41
42
 
43
+ NSString *const CCPetsAntigravityAppBundleIdentifier = @"com.google.antigravity";
44
+
45
+ BOOL IsAntigravityDesktopFocusTarget(NSDictionary *target) {
46
+ if (![target isKindOfClass:NSDictionary.class]) return NO;
47
+ return [target[@"bundleID"] isEqual:CCPetsAntigravityAppBundleIdentifier] &&
48
+ (![target[@"tty"] isKindOfClass:NSString.class] || [target[@"tty"] length] == 0);
49
+ }
50
+
51
+ BOOL AntigravityDesktopApplicationIsRunning(void) {
52
+ for (NSRunningApplication *app in [NSRunningApplication runningApplicationsWithBundleIdentifier:CCPetsAntigravityAppBundleIdentifier]) {
53
+ if (app.terminated || !app.bundleURL) continue;
54
+ // The earlier VS Code-based Antigravity IDE can have the same bundle ID.
55
+ NSString *backend = [app.bundleURL.path stringByAppendingPathComponent:@"Contents/Resources/bin/language_server"];
56
+ if ([NSFileManager.defaultManager isExecutableFileAtPath:backend]) return YES;
57
+ }
58
+ return NO;
59
+ }
60
+
42
61
  NSNumber *CodexPersistentThreadStatus(NSString *thread, NSString *codexHome) {
43
62
  if (thread.length == 0 || !codexHome.isAbsolutePath) return nil;
44
63
  sqlite3 *db = NULL;
@@ -146,6 +165,7 @@ NSDictionary *TerminalFocusTargetFromEnvironment(void) {
146
165
  NSString *bundleID = TerminalTargetValue(environment, @"CC_PETS_TERMINAL_BUNDLE_ID", 128);
147
166
  NSString *ideInstance = TerminalTargetValue(environment, @"CC_PETS_IDE_INSTANCE_ID", 64);
148
167
  NSString *ideTerminal = TerminalTargetValue(environment, @"CC_PETS_IDE_TERMINAL_ID", 64);
168
+ NSString *titleToken = environment[@"CC_PETS_BRIDGE_TITLE_TOKEN"];
149
169
  if (tty.length == 0) tty = SanitizedShortString(ControllingTerminalName(), 64);
150
170
  if (bundleID.length == 0) {
151
171
  bundleID = SanitizedShortString(HostApplicationBundleIdentifier(), 128);
@@ -158,6 +178,7 @@ NSDictionary *TerminalFocusTargetFromEnvironment(void) {
158
178
  if (program.length > 0) target[@"program"] = program;
159
179
  if (session.length > 0) target[@"session"] = session;
160
180
  if (bundleID.length > 0) target[@"bundleID"] = bundleID;
181
+ if (titleToken.length == 36 && [[NSUUID alloc] initWithUUIDString:titleToken]) target[@"bridgeTitleToken"] = titleToken;
161
182
  if (ideInstance.length > 0 && ideTerminal.length > 0) {
162
183
  target[@"ideInstance"] = ideInstance;
163
184
  target[@"ideTerminal"] = ideTerminal;
@@ -372,6 +393,20 @@ static NSMutableDictionary<NSString *, NSDictionary *> *LoadLiveCodexLaunches(vo
372
393
  return launches;
373
394
  }
374
395
 
396
+ static NSDictionary *CodexLaunchTarget(NSDictionary *launch) {
397
+ id terminal = launch[@"terminal"];
398
+ return [terminal isKindOfClass:NSDictionary.class] ? terminal : @{};
399
+ }
400
+
401
+ BOOL CodexHasTerminalTitleLaunch(NSString *cwd) {
402
+ if (!cwd.isAbsolutePath) return NO;
403
+ NSString *directory = cwd.stringByStandardizingPath;
404
+ for (NSDictionary *launch in LoadLiveCodexLaunches().allValues) {
405
+ if ([launch[@"cwd"] isEqual:directory] && CodexLaunchTarget(launch)[@"bridgeTitleToken"]) return YES;
406
+ }
407
+ return NO;
408
+ }
409
+
375
410
  static void SaveCodexLaunches(NSDictionary *launches) {
376
411
  NSData *json = [NSJSONSerialization dataWithJSONObject:launches options:0 error:nil];
377
412
  NSString *path = CodexLaunchRegistryPath();
@@ -487,17 +522,47 @@ static int CodexLogQueryExpired(void *context) {
487
522
  return CFAbsoluteTimeGetCurrent() > *(CFAbsoluteTime *)context;
488
523
  }
489
524
 
490
- static NSString *ReadyCodexLaunch(NSDictionary<NSString *, NSDictionary *> *launches,
491
- NSArray<NSString *> *candidates, NSNumber *createdAt, NSString *codexHome) {
492
- if (!createdAt || createdAt.doubleValue <= 0) return nil;
525
+ static sqlite3 *OpenCodexLogs(NSString *codexHome) {
493
526
  NSString *path = [(codexHome.length ? codexHome : DefaultCodexHomeDirectory())
494
527
  stringByAppendingPathComponent:@"logs_2.sqlite"];
495
528
  sqlite3 *database = NULL;
496
529
  if (sqlite3_open_v2(path.fileSystemRepresentation, &database, SQLITE_OPEN_READONLY | SQLITE_OPEN_NOMUTEX, NULL) != SQLITE_OK) {
497
530
  if (database) sqlite3_close(database);
498
- return nil;
531
+ return NULL;
499
532
  }
500
533
  sqlite3_busy_timeout(database, 50);
534
+ return database;
535
+ }
536
+
537
+ static NSString *RegisteredCodexLaunchForClient(const char *process, NSDictionary<NSString *, NSDictionary *> *launches,
538
+ NSArray<NSString *> *candidates, NSTimeInterval readyAt) {
539
+ if (!process || strncmp(process, "pid:", 4) != 0) return nil;
540
+ char *end;
541
+ long client = strtol(process + 4, &end, 10);
542
+ if (*end != ':' || client <= 1 || client > INT_MAX) return nil;
543
+ // With npm installs, the registered Node launcher is the parent of the native TUI.
544
+ pid_t pid = (pid_t)client;
545
+ for (NSUInteger depth = 0; depth < 8 && pid > 1; depth++) {
546
+ NSString *key = [NSString stringWithFormat:@"%d", pid];
547
+ NSDictionary *launch = launches[key];
548
+ if (launch) {
549
+ return [candidates containsObject:key] && readyAt >= [launch[@"processStartedAt"] doubleValue] &&
550
+ readyAt >= [launch[@"launchedAt"] doubleValue] ? key : nil;
551
+ }
552
+ struct kinfo_proc info;
553
+ if (!ProcessInfoForPID(pid, &info)) break;
554
+ struct timeval started = info.kp_proc.p_starttime;
555
+ if (readyAt < started.tv_sec + started.tv_usec / 1e6) break;
556
+ pid = info.kp_eproc.e_ppid;
557
+ }
558
+ return nil;
559
+ }
560
+
561
+ static NSString *ReadyCodexLaunch(NSDictionary<NSString *, NSDictionary *> *launches,
562
+ NSArray<NSString *> *candidates, NSNumber *createdAt, NSString *codexHome) {
563
+ if (candidates.count == 0 || !createdAt || createdAt.doubleValue <= 0) return nil;
564
+ sqlite3 *database = OpenCodexLogs(codexHome);
565
+ if (!database) return nil;
501
566
  CFAbsoluteTime deadline = CFAbsoluteTimeGetCurrent() + 0.15;
502
567
  sqlite3_progress_handler(database, 1000, CodexLogQueryExpired, &deadline);
503
568
  sqlite3_stmt *statement = NULL;
@@ -517,14 +582,9 @@ static NSString *ReadyCodexLaunch(NSDictionary<NSString *, NSDictionary *> *laun
517
582
  rows++;
518
583
  double readyAt = sqlite3_column_int64(statement, 0) + sqlite3_column_int64(statement, 1) / 1e9;
519
584
  if (readyAt < earliestReadyAt || readyAt > latestReadyAt) continue;
520
- const unsigned char *value = sqlite3_column_text(statement, 2);
521
- NSString *process = value ? @((const char *)value) : @"";
522
- for (NSString *key in candidates) {
523
- NSDictionary *entry = launches[key];
524
- NSString *prefix = [NSString stringWithFormat:@"pid:%d:", [entry[@"pid"] intValue]];
525
- if ([process hasPrefix:prefix] && readyAt >= [entry[@"processStartedAt"] doubleValue] &&
526
- readyAt >= [entry[@"launchedAt"] doubleValue]) [matches addObject:key];
527
- }
585
+ const char *process = (const char *)sqlite3_column_text(statement, 2);
586
+ NSString *key = RegisteredCodexLaunchForClient(process, launches, candidates, readyAt);
587
+ if (key) [matches addObject:key];
528
588
  }
529
589
  complete = result == SQLITE_DONE && rows < 128;
530
590
  }
@@ -533,6 +593,63 @@ static NSString *ReadyCodexLaunch(NSDictionary<NSString *, NSDictionary *> *laun
533
593
  return complete && matches.count == 1 ? matches.anyObject : nil;
534
594
  }
535
595
 
596
+ // 在 TUI 里用 /resume(或不带会话 ID 的 codex resume)接上旧会话时,命令行里没有会话 ID,
597
+ // 会话创建时刻也远早于 TUI 就绪。共享后台的日志记着是哪条 codex-tui 连接发起了 thread/resume;
598
+ // 同一后台进程里这条连接最早的请求紧跟在 TUI 就绪之后,把它当作就绪时刻交给 ReadyCodexLaunch。
599
+ // 桌面端连接的 client_name 不是 codex-tui,不会被配到终端上。
600
+ static NSNumber *CodexResumeClientConnectedAt(NSString *thread, NSTimeInterval earliest, NSString *codexHome) {
601
+ if (thread.length == 0 || !(earliest > 0)) return nil;
602
+ sqlite3 *database = OpenCodexLogs(codexHome);
603
+ if (!database) return nil;
604
+ CFAbsoluteTime deadline = CFAbsoluteTimeGetCurrent() + 0.15;
605
+ sqlite3_progress_handler(database, 1000, CodexLogQueryExpired, &deadline);
606
+ sqlite3_stmt *statement = NULL;
607
+ double resumedAt = 0;
608
+ NSString *process = nil, *connection = nil;
609
+ const char *resumeQuery = "SELECT ts, ts_nanos, process_uuid, feedback_log_body FROM logs "
610
+ "WHERE thread_id = ? AND feedback_log_body LIKE '%rpc.method=\"thread/resume\"%' "
611
+ "AND feedback_log_body LIKE '%app_server.client_name=\"codex-tui\"%' "
612
+ "ORDER BY ts DESC, ts_nanos DESC LIMIT 1";
613
+ if (sqlite3_prepare_v2(database, resumeQuery, -1, &statement, NULL) == SQLITE_OK) {
614
+ sqlite3_bind_text(statement, 1, thread.UTF8String, -1, SQLITE_TRANSIENT);
615
+ if (sqlite3_step(statement) == SQLITE_ROW) {
616
+ resumedAt = sqlite3_column_int64(statement, 0) + sqlite3_column_int64(statement, 1) / 1e9;
617
+ const char *uuid = (const char *)sqlite3_column_text(statement, 2);
618
+ const char *body = (const char *)sqlite3_column_text(statement, 3);
619
+ process = uuid ? @(uuid) : nil;
620
+ NSString *text = body ? @(body) : nil;
621
+ NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:
622
+ @"app_server\\.connection_id=([0-9]{1,9})[ }]" options:0 error:nil];
623
+ NSTextCheckingResult *match = text ? [pattern firstMatchInString:text options:0
624
+ range:NSMakeRange(0, text.length)] : nil;
625
+ if (match) connection = [text substringWithRange:[match rangeAtIndex:1]];
626
+ }
627
+ }
628
+ if (statement) sqlite3_finalize(statement);
629
+ statement = NULL;
630
+ NSNumber *connectedAt = nil;
631
+ // 连接号只在同一个后台进程内唯一,所以按 process_uuid 限定;时间下界是候选终端的登记时刻。
632
+ if (process.length > 0 && connection.length > 0 && resumedAt >= earliest) {
633
+ const char *startQuery = "SELECT ts, ts_nanos FROM logs WHERE ts BETWEEN ? AND ? AND process_uuid = ? "
634
+ "AND (feedback_log_body LIKE ? OR feedback_log_body LIKE ?) ORDER BY ts, ts_nanos LIMIT 1";
635
+ if (sqlite3_prepare_v2(database, startQuery, -1, &statement, NULL) == SQLITE_OK) {
636
+ NSString *spaced = [NSString stringWithFormat:@"%%app_server.connection_id=%@ %%", connection];
637
+ NSString *closed = [NSString stringWithFormat:@"%%app_server.connection_id=%@}%%", connection];
638
+ sqlite3_bind_int64(statement, 1, (sqlite3_int64)floor(earliest));
639
+ sqlite3_bind_int64(statement, 2, (sqlite3_int64)ceil(resumedAt));
640
+ sqlite3_bind_text(statement, 3, process.UTF8String, -1, SQLITE_TRANSIENT);
641
+ sqlite3_bind_text(statement, 4, spaced.UTF8String, -1, SQLITE_TRANSIENT);
642
+ sqlite3_bind_text(statement, 5, closed.UTF8String, -1, SQLITE_TRANSIENT);
643
+ if (sqlite3_step(statement) == SQLITE_ROW) {
644
+ connectedAt = @(sqlite3_column_int64(statement, 0) + sqlite3_column_int64(statement, 1) / 1e9);
645
+ }
646
+ }
647
+ if (statement) sqlite3_finalize(statement);
648
+ }
649
+ sqlite3_close(database);
650
+ return connectedAt;
651
+ }
652
+
536
653
  // 显式 resume 优先按会话 ID;新会话用客户端就绪证据。多个同目录客户端时不能用
537
654
  // “最新未绑定的进程”兜底:网络启动延迟和首次发消息的顺序都可能与启动顺序不同。
538
655
  static NSString *ChooseCodexLaunch(NSDictionary<NSString *, NSDictionary *> *launches,
@@ -552,7 +669,19 @@ static NSString *ChooseCodexLaunch(NSDictionary<NSString *, NSDictionary *> *lau
552
669
  if (resumed.count > 0) return resumed.count == 1 ? resumed.firstObject : nil;
553
670
  NSString *ready = ReadyCodexLaunch(launches, sameDirectory, createdAt, codexHome);
554
671
  if (ready) return ready;
555
- return sameDirectory.count == 1 ? sameDirectory.firstObject : nil;
672
+ NSTimeInterval earliest = 0;
673
+ for (NSString *key in sameDirectory) {
674
+ NSTimeInterval launchedAt = [launches[key][@"launchedAt"] doubleValue];
675
+ if (launchedAt > 0 && (earliest == 0 || launchedAt < earliest)) earliest = launchedAt;
676
+ }
677
+ NSNumber *connectedAt = CodexResumeClientConnectedAt(thread, earliest, codexHome);
678
+ NSString *resumedInClient = connectedAt ? ReadyCodexLaunch(launches, sameDirectory, connectedAt, codexHome) : nil;
679
+ if (resumedInClient) return resumedInClient;
680
+ if (sameDirectory.count != 1) return nil;
681
+ NSString *onlyLaunch = sameDirectory.firstObject;
682
+ // A shared host can also serve a desktop conversation in this directory. A title
683
+ // relay waits for its own TUI evidence, which may not have reached SQLite yet.
684
+ return CodexLaunchTarget(launches[onlyLaunch])[@"bridgeTitleToken"] ? nil : onlyLaunch;
556
685
  }
557
686
 
558
687
  static NSDictionary *CodexLaunchTerminalForThreadAtHome(NSString *thread, NSDictionary *payload,
@@ -560,43 +689,37 @@ static NSDictionary *CodexLaunchTerminalForThreadAtHome(NSString *thread, NSDict
560
689
  if (thread.length == 0) return @{};
561
690
  int lock = LockCodexLaunchRegistry();
562
691
  if (lock < 0) return @{};
563
- NSMutableDictionary<NSString *, NSDictionary *> *launches = LoadLiveCodexLaunches();
564
- NSDictionary *terminal = nil;
565
- for (NSDictionary *entry in launches.allValues) {
566
- if ([entry[@"threads"] containsObject:thread]) {
567
- terminal = entry[@"terminal"];
568
- break;
692
+ @try {
693
+ NSMutableDictionary<NSString *, NSDictionary *> *launches = LoadLiveCodexLaunches();
694
+ for (NSDictionary *entry in launches.allValues) {
695
+ if ([entry[@"threads"] containsObject:thread]) return CodexLaunchTarget(entry);
569
696
  }
570
- }
571
- if (!terminal) {
572
697
  NSDictionary *meta = CodexThreadMeta(thread, payload, codexHome);
573
698
  NSString *key = meta[@"cwd"] ? ChooseCodexLaunch(launches, meta[@"cwd"], meta[@"createdAt"], thread, codexHome) : nil;
574
- if (key) {
575
- NSMutableDictionary *entry = [launches[key] mutableCopy];
576
- NSMutableArray *threads = [entry[@"threads"] mutableCopy] ?: [NSMutableArray array];
577
- [threads addObject:thread];
578
- while (threads.count > CodexLaunchThreadLimit) [threads removeObjectAtIndex:0];
579
- entry[@"threads"] = threads;
580
- launches[key] = entry;
581
- terminal = entry[@"terminal"];
582
- }
699
+ if (!key) return @{};
700
+ NSMutableDictionary *entry = [launches[key] mutableCopy];
701
+ NSMutableArray *threads = [entry[@"threads"] mutableCopy] ?: [NSMutableArray array];
702
+ [threads addObject:thread];
703
+ while (threads.count > CodexLaunchThreadLimit) [threads removeObjectAtIndex:0];
704
+ entry[@"threads"] = threads;
705
+ launches[key] = entry;
706
+ SaveCodexLaunches(launches);
707
+ return CodexLaunchTarget(entry);
708
+ } @finally {
709
+ UnlockCodexLaunchRegistry(lock);
583
710
  }
584
- SaveCodexLaunches(launches);
585
- UnlockCodexLaunchRegistry(lock);
586
- return [terminal isKindOfClass:NSDictionary.class] ? terminal : @{};
587
711
  }
588
712
 
589
713
  NSDictionary *CodexLaunchTerminalForThread(NSString *thread, NSDictionary *payload) {
590
- return CodexLaunchTerminalForThreadAtHome(thread, payload, DefaultCodexHomeDirectory());
714
+ // 是路径,不能走 SanitizedShortString:它会删掉 `/`,拼出一个不存在的目录。
715
+ NSString *profileHome = NSProcessInfo.processInfo.environment[@"CC_PETS_PROFILE_HOME"];
716
+ profileHome = [profileHome isKindOfClass:NSString.class] && profileHome.isAbsolutePath
717
+ ? profileHome.stringByStandardizingPath : nil;
718
+ return CodexLaunchTerminalForThreadAtHome(thread, payload, profileHome);
591
719
  }
592
720
 
593
721
  NSDictionary *TerminalFocusTargetForHook(NSDictionary *payload, NSString *provider) {
594
722
  if (!TerminalFocusRunsUnderSharedAgentHost()) return TerminalFocusTargetFromEnvironment();
595
723
  if (![provider isEqualToString:@"Codex"]) return @{};
596
- // 是路径,不能走 SanitizedShortString:它会删掉 `/`,拼出一个不存在的目录。
597
- NSString *profileHome = NSProcessInfo.processInfo.environment[@"CC_PETS_PROFILE_HOME"];
598
- profileHome = [profileHome isKindOfClass:NSString.class] && profileHome.isAbsolutePath
599
- ? profileHome.stringByStandardizingPath : nil;
600
- return CodexLaunchTerminalForThreadAtHome(
601
- SanitizedShortString(payload[@"session_id"], 128), payload, profileHome);
724
+ return CodexLaunchTerminalForThread(SanitizedShortString(payload[@"session_id"], 128), payload);
602
725
  }