@kaitranntt/ccs 4.3.5 → 4.3.7

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.5
1
+ 4.3.7
package/bin/ccs.js CHANGED
@@ -207,7 +207,8 @@ function handleHelpCommand() {
207
207
  console.log(' Commands: ~/.ccs/shared/commands/');
208
208
  console.log(' Skills: ~/.ccs/shared/skills/');
209
209
  console.log(' Agents: ~/.ccs/shared/agents/');
210
- console.log(' Note: Commands, skills, and agents are symlinked across all profiles');
210
+ console.log(' Plugins: ~/.ccs/shared/plugins/');
211
+ console.log(' Note: Commands, skills, agents, and plugins are symlinked across all profiles');
211
212
  console.log('');
212
213
 
213
214
  // Examples
@@ -17,7 +17,7 @@ class SharedManager {
17
17
  this.sharedDir = path.join(this.homeDir, '.ccs', 'shared');
18
18
  this.claudeDir = path.join(this.homeDir, '.claude');
19
19
  this.instancesDir = path.join(this.homeDir, '.ccs', 'instances');
20
- this.sharedDirs = ['commands', 'skills', 'agents'];
20
+ this.sharedDirs = ['commands', 'skills', 'agents', 'plugins'];
21
21
  }
22
22
 
23
23
  /**
@@ -4,7 +4,15 @@
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
+ let ora = null;
10
+ try {
11
+ ora = require('ora');
12
+ } catch (e) {
13
+ // ora not available, will use console.log instead
14
+ }
15
+
8
16
  const { colored } = require('./helpers');
9
17
 
10
18
  /**
@@ -23,7 +31,7 @@ class ClaudeDirInstaller {
23
31
  * @param {boolean} silent - Suppress spinner output
24
32
  */
25
33
  install(packageDir, silent = false) {
26
- const spinner = silent ? null : ora('Copying .claude/ items to ~/.ccs/.claude/').start();
34
+ const spinner = (silent || !ora) ? null : ora('Copying .claude/ items to ~/.ccs/.claude/').start();
27
35
 
28
36
  try {
29
37
  // Auto-detect package directory if not provided
@@ -3,7 +3,15 @@
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
+ let ora = null;
9
+ try {
10
+ ora = require('ora');
11
+ } catch (e) {
12
+ // ora not available, will use console.log instead
13
+ }
14
+
7
15
  const { colored } = require('./helpers');
8
16
 
9
17
  /**
@@ -37,7 +45,7 @@ class ClaudeSymlinkManager {
37
45
  * Safe: backs up existing files before creating symlinks
38
46
  */
39
47
  install(silent = false) {
40
- const spinner = silent ? null : ora('Installing CCS items to ~/.claude/').start();
48
+ const spinner = (silent || !ora) ? null : ora('Installing CCS items to ~/.claude/').start();
41
49
 
42
50
  // Ensure ~/.ccs/.claude/ exists (should be shipped with package)
43
51
  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.5"
5
+ CCS_VERSION="4.3.7"
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"
@@ -222,7 +222,8 @@ show_help() {
222
222
  echo -e " Commands: ~/.ccs/shared/commands/"
223
223
  echo -e " Skills: ~/.ccs/shared/skills/"
224
224
  echo -e " Agents: ~/.ccs/shared/agents/"
225
- echo -e " Note: Commands, skills, and agents are symlinked across all profiles"
225
+ echo -e " Plugins: ~/.ccs/shared/plugins/"
226
+ echo -e " Note: Commands, skills, agents, and plugins are symlinked across all profiles"
226
227
  echo ""
227
228
 
228
229
  echo -e "${CYAN}Examples:${RESET}"
@@ -980,10 +981,10 @@ link_shared_directories() {
980
981
  local shared_dir="$HOME/.ccs/shared"
981
982
 
982
983
  # Ensure shared directories exist
983
- mkdir -p "$shared_dir"/{commands,skills,agents}
984
+ mkdir -p "$shared_dir"/{commands,skills,agents,plugins}
984
985
 
985
986
  # Create symlinks (remove existing first if present)
986
- for dir in commands skills agents; do
987
+ for dir in commands skills agents plugins; do
987
988
  local link_path="$instance_path/$dir"
988
989
  local target_path="$shared_dir/$dir"
989
990
 
@@ -1002,7 +1003,7 @@ migrate_to_shared_structure() {
1002
1003
  # Check if migration is needed (shared dirs exist but are empty)
1003
1004
  if [[ -d "$shared_dir" ]]; then
1004
1005
  local needs_migration=false
1005
- for dir in commands skills agents; do
1006
+ for dir in commands skills agents plugins; do
1006
1007
  if [[ ! -d "$shared_dir/$dir" ]] || [[ -z "$(ls -A "$shared_dir/$dir" 2>/dev/null)" ]]; then
1007
1008
  needs_migration=true
1008
1009
  break
@@ -1013,7 +1014,7 @@ migrate_to_shared_structure() {
1013
1014
  fi
1014
1015
 
1015
1016
  # Create shared directory
1016
- mkdir -p "$shared_dir"/{commands,skills,agents}
1017
+ mkdir -p "$shared_dir"/{commands,skills,agents,plugins}
1017
1018
 
1018
1019
  # Copy from ~/.claude/ (actual Claude CLI directory)
1019
1020
  local claude_dir="$HOME/.claude"
@@ -1030,6 +1031,10 @@ migrate_to_shared_structure() {
1030
1031
  # Copy agents to shared (if exists)
1031
1032
  [[ -d "$claude_dir/agents" ]] && \
1032
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
1033
1038
  fi
1034
1039
 
1035
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.5"
15
+ $CcsVersion = "4.3.7"
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"
@@ -269,7 +269,8 @@ function Show-Help {
269
269
  Write-Host " Commands: ~/.ccs/shared/commands/"
270
270
  Write-Host " Skills: ~/.ccs/shared/skills/"
271
271
  Write-Host " Agents: ~/.ccs/shared/agents/"
272
- Write-Host " Note: Commands, skills, and agents are symlinked across all profiles"
272
+ Write-Host " Plugins: ~/.ccs/shared/plugins/"
273
+ Write-Host " Note: Commands, skills, agents, and plugins are symlinked across all profiles"
273
274
  Write-Host ""
274
275
 
275
276
  Write-ColorLine "Examples:" "Cyan"
@@ -658,7 +659,7 @@ function Link-SharedDirectories {
658
659
  $SharedDir = "$env:USERPROFILE\.ccs\shared"
659
660
 
660
661
  # Ensure shared directories exist
661
- @('commands', 'skills', 'agents') | ForEach-Object {
662
+ @('commands', 'skills', 'agents', 'plugins') | ForEach-Object {
662
663
  $Dir = Join-Path $SharedDir $_
663
664
  if (-not (Test-Path $Dir)) {
664
665
  New-Item -ItemType Directory -Path $Dir -Force | Out-Null
@@ -666,7 +667,7 @@ function Link-SharedDirectories {
666
667
  }
667
668
 
668
669
  # Create symlinks (requires Windows Developer Mode or admin)
669
- @('commands', 'skills', 'agents') | ForEach-Object {
670
+ @('commands', 'skills', 'agents', 'plugins') | ForEach-Object {
670
671
  $LinkPath = Join-Path $InstancePath $_
671
672
  $TargetPath = Join-Path $SharedDir $_
672
673
 
@@ -692,7 +693,7 @@ function Migrate-SharedStructure {
692
693
  # Check if migration is needed (shared dirs exist but are empty)
693
694
  if (Test-Path $SharedDir) {
694
695
  $NeedsMigration = $false
695
- foreach ($Dir in @('commands', 'skills', 'agents')) {
696
+ foreach ($Dir in @('commands', 'skills', 'agents', 'plugins')) {
696
697
  $DirPath = Join-Path $SharedDir $Dir
697
698
  if (-not (Test-Path $DirPath) -or (Get-ChildItem $DirPath -ErrorAction SilentlyContinue).Count -eq 0) {
698
699
  $NeedsMigration = $true
@@ -704,7 +705,7 @@ function Migrate-SharedStructure {
704
705
  }
705
706
 
706
707
  # Create shared directory
707
- @('commands', 'skills', 'agents') | ForEach-Object {
708
+ @('commands', 'skills', 'agents', 'plugins') | ForEach-Object {
708
709
  $Dir = Join-Path $SharedDir $_
709
710
  New-Item -ItemType Directory -Path $Dir -Force | Out-Null
710
711
  }
@@ -730,6 +731,12 @@ function Migrate-SharedStructure {
730
731
  if (Test-Path $AgentsPath) {
731
732
  Copy-Item "$AgentsPath\*" -Destination "$SharedDir\agents\" -Recurse -ErrorAction SilentlyContinue
732
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
+ }
733
740
  }
734
741
 
735
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.5",
3
+ "version": "4.3.7",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",
@@ -81,7 +81,7 @@ function createConfigFiles() {
81
81
  }
82
82
 
83
83
  // Create shared subdirectories
84
- const sharedSubdirs = ['commands', 'skills', 'agents'];
84
+ const sharedSubdirs = ['commands', 'skills', 'agents', 'plugins'];
85
85
  for (const subdir of sharedSubdirs) {
86
86
  const subdirPath = path.join(sharedDir, subdir);
87
87
  if (!fs.existsSync(subdirPath)) {