cc-pets 0.2.19 → 1.0.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.
@@ -42,6 +42,7 @@ static NSString *const NotificationCompletionKey = @"CCPetsNotifyCompletion";
42
42
  static NSString *const NotificationFailureKey = @"CCPetsNotifyFailure";
43
43
  static NSString *const NotificationApprovalKey = @"CCPetsNotifyApproval";
44
44
  static NSString *const StatusBubbleExpandedKey = @"CCPetsStatusBubbleExpanded";
45
+ static NSString *const StatusBubblePreferenceV2Key = @"CCPetsStatusBubblePreferenceV2";
45
46
  static const NSTimeInterval AgentStatusInactivityInterval = 60.0;
46
47
 
47
48
  static NSString *SanitizedShortString(id value, NSUInteger maximumLength) {
@@ -1650,6 +1651,13 @@ static int RenderMenuSwitches(NSString *path) {
1650
1651
  @"--allow-scripts=cc-pets",
1651
1652
  @"--prefer-online"
1652
1653
  ];
1654
+ NSMutableDictionary<NSString *, NSString *> *environment =
1655
+ [NSProcessInfo.processInfo.environment mutableCopy];
1656
+ NSString *nodeDirectory = nodePath.stringByDeletingLastPathComponent;
1657
+ NSString *existingPath = environment[@"PATH"];
1658
+ if (existingPath.length == 0) existingPath = @"/usr/bin:/bin:/usr/sbin:/sbin";
1659
+ environment[@"PATH"] = [NSString stringWithFormat:@"%@:%@", nodeDirectory, existingPath];
1660
+ task.environment = environment;
1653
1661
  task.currentDirectoryURL = [NSURL fileURLWithPath:NSHomeDirectory()];
1654
1662
  task.standardOutput = logHandle;
1655
1663
  task.standardError = logHandle;
@@ -1834,7 +1842,7 @@ static int RenderMenuSwitches(NSString *path) {
1834
1842
  }
1835
1843
  - (NSString *)statusDetailForState:(NSString *)state {
1836
1844
  if ([state isEqualToString:@"starting"]) return @"正在准备当前会话…";
1837
- if ([state isEqualToString:@"thinking"]) return @"Agent 正在分析请求…";
1845
+ if ([state isEqualToString:@"thinking"]) return @"正在分析请求…";
1838
1846
  if ([state isEqualToString:@"approval"]) return @"请回到终端确认操作。";
1839
1847
  if ([state isEqualToString:@"subagent"]) return @"正在协调子 Agent。";
1840
1848
  if ([state isEqualToString:@"tool"]) return @"正在调用工具…";
@@ -1842,8 +1850,8 @@ static int RenderMenuSwitches(NSString *path) {
1842
1850
  if ([state isEqualToString:@"tool_failed"]) return @"工具执行失败,请查看终端。";
1843
1851
  if ([state isEqualToString:@"completed"]) return @"好的,当前任务已经完成。";
1844
1852
  if ([state isEqualToString:@"failed"]) return @"任务失败,请回到终端查看详情。";
1845
- if ([state isEqualToString:@"notification"]) return @"Agent 有一条状态需要你关注。";
1846
- return @"Agent 正在处理当前任务。";
1853
+ if ([state isEqualToString:@"notification"]) return @"有一条状态需要你关注。";
1854
+ return @"正在处理当前任务。";
1847
1855
  }
1848
1856
  - (NSColor *)statusColorForState:(NSString *)state {
1849
1857
  if ([state isEqualToString:@"completed"] || [state isEqualToString:@"tool_completed"]) {
@@ -2081,6 +2089,10 @@ static int RenderMenuSwitches(NSString *path) {
2081
2089
  }
2082
2090
  NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults;
2083
2091
  [defaults registerDefaults:@{StatusBubbleExpandedKey: @YES}];
2092
+ if (![defaults boolForKey:StatusBubblePreferenceV2Key]) {
2093
+ [defaults setBool:YES forKey:StatusBubbleExpandedKey];
2094
+ [defaults setBool:YES forKey:StatusBubblePreferenceV2Key];
2095
+ }
2084
2096
  self.statusBubbleExpanded = [defaults boolForKey:StatusBubbleExpandedKey];
2085
2097
  NSString *selected = [defaults stringForKey:@"CCPetsSelectedSprite"];
2086
2098
  if (selected.length == 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-pets",
3
- "version": "0.2.19",
3
+ "version": "1.0.1",
4
4
  "description": "A native macOS desktop pet for Codex CLI and Claude Code",
5
5
  "author": "wangxinyusqn",
6
6
  "license": "MIT",
@@ -11,14 +11,24 @@ END_MARKER="# <<< cc-pets-codex <<<"
11
11
  CLAUDE_START_MARKER="# >>> cc-pets-claude >>>"
12
12
  CLAUDE_END_MARKER="# <<< cc-pets-claude <<<"
13
13
 
14
- node "${PROJECT_DIR}/scripts/uninstall-integrations.mjs" --prepare-install "${SHELL_RC}"
14
+ NODE_EXECUTABLE="${npm_node_execpath:-}"
15
+ if [[ -z "${NODE_EXECUTABLE}" || ! -x "${NODE_EXECUTABLE}" ]]; then
16
+ NODE_EXECUTABLE="$(command -v node || true)"
17
+ fi
18
+ if [[ -z "${NODE_EXECUTABLE}" || ! -x "${NODE_EXECUTABLE}" ]]; then
19
+ print -u2 "安装失败:找不到可执行的 Node.js。"
20
+ exit 1
21
+ fi
22
+ export PATH="${NODE_EXECUTABLE:h}:${PATH:-/usr/bin:/bin:/usr/sbin:/sbin}"
23
+
24
+ "${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/uninstall-integrations.mjs" --prepare-install "${SHELL_RC}"
15
25
  "${PROJECT_DIR}/scripts/build.sh"
16
26
  "${PROJECT_DIR}/scripts/install-app.sh"
17
- node "${PROJECT_DIR}/scripts/install-codex-hooks.mjs" "${PROJECT_DIR}/.build/release/cc-pets"
18
- node "${PROJECT_DIR}/scripts/install-claude-hooks.mjs" \
27
+ "${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/install-codex-hooks.mjs" "${PROJECT_DIR}/.build/release/cc-pets"
28
+ "${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/install-claude-hooks.mjs" \
19
29
  "${PROJECT_DIR}/.build/release/cc-pets" \
20
30
  "${PROJECT_DIR}/bin/claude-statusline-with-pet"
21
- node "${PROJECT_DIR}/scripts/configure-updater.mjs"
31
+ "${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/configure-updater.mjs"
22
32
 
23
33
  PET_APP="${PROJECT_DIR}/.build/release/CC Pets.app"
24
34
  PET_APP_EXECUTABLE="${PET_APP}/Contents/MacOS/cc-pets"