@kaitranntt/ccs 4.3.6 → 4.3.8

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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.3.6
1
+ 4.3.8
@@ -6,7 +6,28 @@ const os = require('os');
6
6
  const { spawn } = require('child_process');
7
7
  const { colored } = require('../utils/helpers');
8
8
  const { detectClaudeCli } = require('../utils/claude-detector');
9
- const ora = require('ora');
9
+
10
+ // Make ora optional (might not be available during npm install postinstall)
11
+ // ora v9+ is an ES module, need to use .default for CommonJS
12
+ let ora = null;
13
+ try {
14
+ const oraModule = require('ora');
15
+ ora = oraModule.default || oraModule;
16
+ } catch (e) {
17
+ // ora not available, create fallback spinner that uses console.log
18
+ ora = function(text) {
19
+ return {
20
+ start: () => ({
21
+ succeed: (msg) => console.log(msg || `[OK] ${text}`),
22
+ fail: (msg) => console.log(msg || `[X] ${text}`),
23
+ warn: (msg) => console.log(msg || `[!] ${text}`),
24
+ info: (msg) => console.log(msg || `[i] ${text}`),
25
+ text: ''
26
+ })
27
+ };
28
+ };
29
+ }
30
+
10
31
  const Table = require('cli-table3');
11
32
 
12
33
  /**
@@ -4,7 +4,28 @@
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
6
  const os = require('os');
7
- const ora = require('ora');
7
+
8
+ // Make ora optional (might not be available during npm install postinstall)
9
+ // ora v9+ is an ES module, need to use .default for CommonJS
10
+ let ora = null;
11
+ try {
12
+ const oraModule = require('ora');
13
+ ora = oraModule.default || oraModule;
14
+ } catch (e) {
15
+ // ora not available, create fallback spinner that uses console.log
16
+ ora = function(text) {
17
+ return {
18
+ start: () => ({
19
+ succeed: (msg) => console.log(msg || `[OK] ${text}`),
20
+ fail: (msg) => console.log(msg || `[X] ${text}`),
21
+ warn: (msg) => console.log(msg || `[!] ${text}`),
22
+ info: (msg) => console.log(msg || `[i] ${text}`),
23
+ text: ''
24
+ })
25
+ };
26
+ };
27
+ }
28
+
8
29
  const { colored } = require('./helpers');
9
30
 
10
31
  /**
@@ -23,7 +44,7 @@ class ClaudeDirInstaller {
23
44
  * @param {boolean} silent - Suppress spinner output
24
45
  */
25
46
  install(packageDir, silent = false) {
26
- const spinner = silent ? null : ora('Copying .claude/ items to ~/.ccs/.claude/').start();
47
+ const spinner = (silent || !ora) ? null : ora('Copying .claude/ items to ~/.ccs/.claude/').start();
27
48
 
28
49
  try {
29
50
  // Auto-detect package directory if not provided
@@ -3,7 +3,28 @@
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const os = require('os');
6
- const ora = require('ora');
6
+
7
+ // Make ora optional (might not be available during npm install postinstall)
8
+ // ora v9+ is an ES module, need to use .default for CommonJS
9
+ let ora = null;
10
+ try {
11
+ const oraModule = require('ora');
12
+ ora = oraModule.default || oraModule;
13
+ } catch (e) {
14
+ // ora not available, create fallback spinner that uses console.log
15
+ ora = function(text) {
16
+ return {
17
+ start: () => ({
18
+ succeed: (msg) => console.log(msg || `[OK] ${text}`),
19
+ fail: (msg) => console.log(msg || `[X] ${text}`),
20
+ warn: (msg) => console.log(msg || `[!] ${text}`),
21
+ info: (msg) => console.log(msg || `[i] ${text}`),
22
+ text: ''
23
+ })
24
+ };
25
+ };
26
+ }
27
+
7
28
  const { colored } = require('./helpers');
8
29
 
9
30
  /**
@@ -37,7 +58,7 @@ class ClaudeSymlinkManager {
37
58
  * Safe: backs up existing files before creating symlinks
38
59
  */
39
60
  install(silent = false) {
40
- const spinner = silent ? null : ora('Installing CCS items to ~/.claude/').start();
61
+ const spinner = (silent || !ora) ? null : ora('Installing CCS items to ~/.claude/').start();
41
62
 
42
63
  // Ensure ~/.ccs/.claude/ exists (should be shipped with package)
43
64
  if (!fs.existsSync(this.ccsClaudeDir)) {
package/lib/ccs CHANGED
@@ -2,7 +2,7 @@
2
2
  set -euo pipefail
3
3
 
4
4
  # Version (updated by scripts/bump-version.sh)
5
- CCS_VERSION="4.3.6"
5
+ CCS_VERSION="4.3.8"
6
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
7
  readonly CONFIG_FILE="${CCS_CONFIG:-$HOME/.ccs/config.json}"
8
8
  readonly PROFILES_JSON="$HOME/.ccs/profiles.json"
@@ -981,10 +981,10 @@ link_shared_directories() {
981
981
  local shared_dir="$HOME/.ccs/shared"
982
982
 
983
983
  # Ensure shared directories exist
984
- mkdir -p "$shared_dir"/{commands,skills,agents}
984
+ mkdir -p "$shared_dir"/{commands,skills,agents,plugins}
985
985
 
986
986
  # Create symlinks (remove existing first if present)
987
- for dir in commands skills agents; do
987
+ for dir in commands skills agents plugins; do
988
988
  local link_path="$instance_path/$dir"
989
989
  local target_path="$shared_dir/$dir"
990
990
 
@@ -1003,7 +1003,7 @@ migrate_to_shared_structure() {
1003
1003
  # Check if migration is needed (shared dirs exist but are empty)
1004
1004
  if [[ -d "$shared_dir" ]]; then
1005
1005
  local needs_migration=false
1006
- for dir in commands skills agents; do
1006
+ for dir in commands skills agents plugins; do
1007
1007
  if [[ ! -d "$shared_dir/$dir" ]] || [[ -z "$(ls -A "$shared_dir/$dir" 2>/dev/null)" ]]; then
1008
1008
  needs_migration=true
1009
1009
  break
@@ -1014,7 +1014,7 @@ migrate_to_shared_structure() {
1014
1014
  fi
1015
1015
 
1016
1016
  # Create shared directory
1017
- mkdir -p "$shared_dir"/{commands,skills,agents}
1017
+ mkdir -p "$shared_dir"/{commands,skills,agents,plugins}
1018
1018
 
1019
1019
  # Copy from ~/.claude/ (actual Claude CLI directory)
1020
1020
  local claude_dir="$HOME/.claude"
@@ -1031,6 +1031,10 @@ migrate_to_shared_structure() {
1031
1031
  # Copy agents to shared (if exists)
1032
1032
  [[ -d "$claude_dir/agents" ]] && \
1033
1033
  cp -r "$claude_dir/agents"/* "$shared_dir/agents/" 2>/dev/null || true
1034
+
1035
+ # Copy plugins to shared (if exists)
1036
+ [[ -d "$claude_dir/plugins" ]] && \
1037
+ cp -r "$claude_dir/plugins"/* "$shared_dir/plugins/" 2>/dev/null || true
1034
1038
  fi
1035
1039
 
1036
1040
  # Update all instances to use symlinks
package/lib/ccs.ps1 CHANGED
@@ -12,7 +12,7 @@ param(
12
12
  $ErrorActionPreference = "Stop"
13
13
 
14
14
  # Version (updated by scripts/bump-version.sh)
15
- $CcsVersion = "4.3.6"
15
+ $CcsVersion = "4.3.8"
16
16
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
17
17
  $ConfigFile = if ($env:CCS_CONFIG) { $env:CCS_CONFIG } else { "$env:USERPROFILE\.ccs\config.json" }
18
18
  $ProfilesJson = "$env:USERPROFILE\.ccs\profiles.json"
@@ -659,7 +659,7 @@ function Link-SharedDirectories {
659
659
  $SharedDir = "$env:USERPROFILE\.ccs\shared"
660
660
 
661
661
  # Ensure shared directories exist
662
- @('commands', 'skills', 'agents') | ForEach-Object {
662
+ @('commands', 'skills', 'agents', 'plugins') | ForEach-Object {
663
663
  $Dir = Join-Path $SharedDir $_
664
664
  if (-not (Test-Path $Dir)) {
665
665
  New-Item -ItemType Directory -Path $Dir -Force | Out-Null
@@ -667,7 +667,7 @@ function Link-SharedDirectories {
667
667
  }
668
668
 
669
669
  # Create symlinks (requires Windows Developer Mode or admin)
670
- @('commands', 'skills', 'agents') | ForEach-Object {
670
+ @('commands', 'skills', 'agents', 'plugins') | ForEach-Object {
671
671
  $LinkPath = Join-Path $InstancePath $_
672
672
  $TargetPath = Join-Path $SharedDir $_
673
673
 
@@ -693,7 +693,7 @@ function Migrate-SharedStructure {
693
693
  # Check if migration is needed (shared dirs exist but are empty)
694
694
  if (Test-Path $SharedDir) {
695
695
  $NeedsMigration = $false
696
- foreach ($Dir in @('commands', 'skills', 'agents')) {
696
+ foreach ($Dir in @('commands', 'skills', 'agents', 'plugins')) {
697
697
  $DirPath = Join-Path $SharedDir $Dir
698
698
  if (-not (Test-Path $DirPath) -or (Get-ChildItem $DirPath -ErrorAction SilentlyContinue).Count -eq 0) {
699
699
  $NeedsMigration = $true
@@ -705,7 +705,7 @@ function Migrate-SharedStructure {
705
705
  }
706
706
 
707
707
  # Create shared directory
708
- @('commands', 'skills', 'agents') | ForEach-Object {
708
+ @('commands', 'skills', 'agents', 'plugins') | ForEach-Object {
709
709
  $Dir = Join-Path $SharedDir $_
710
710
  New-Item -ItemType Directory -Path $Dir -Force | Out-Null
711
711
  }
@@ -731,6 +731,12 @@ function Migrate-SharedStructure {
731
731
  if (Test-Path $AgentsPath) {
732
732
  Copy-Item "$AgentsPath\*" -Destination "$SharedDir\agents\" -Recurse -ErrorAction SilentlyContinue
733
733
  }
734
+
735
+ # Copy plugins to shared (if exists)
736
+ $PluginsPath = Join-Path $ClaudeDir "plugins"
737
+ if (Test-Path $PluginsPath) {
738
+ Copy-Item "$PluginsPath\*" -Destination "$SharedDir\plugins\" -Recurse -ErrorAction SilentlyContinue
739
+ }
734
740
  }
735
741
 
736
742
  # Update all instances to use symlinks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitranntt/ccs",
3
- "version": "4.3.6",
3
+ "version": "4.3.8",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",