clideck 1.30.7 → 1.30.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/config.js CHANGED
@@ -107,6 +107,23 @@ function matchPreset(cmd) {
107
107
  return PRESETS.find(p => binName(p.command) === bin);
108
108
  }
109
109
 
110
+ function firstCommandToken(command) {
111
+ const raw = String(command || '').trim();
112
+ const m = raw.match(/^(['"])(.*?)\1|^(\S+)/);
113
+ return m ? (m[2] || m[3] || '') : '';
114
+ }
115
+
116
+ function commandPathMissing(command) {
117
+ const token = firstCommandToken(command);
118
+ return !token || (token.startsWith('/') && !existsSync(token));
119
+ }
120
+
121
+ function isShellCommand(cmd, preset) {
122
+ return preset?.presetId === 'shell'
123
+ || cmd.presetId === 'shell'
124
+ || (!cmd.isAgent && !cmd.presetId && String(cmd.label || '').toLowerCase() === 'shell');
125
+ }
126
+
110
127
  function migrate(cfg) {
111
128
  // Migrate profiles → defaultTheme
112
129
  if (cfg.profiles && !cfg.defaultTheme) {
@@ -118,8 +135,13 @@ function migrate(cfg) {
118
135
  if (!cfg.defaultTheme || cfg.defaultTheme === 'solarized-dark') cfg.defaultTheme = 'catppuccin-mocha';
119
136
  // Backfill and sync fields from presets
120
137
  for (const cmd of cfg.commands) {
121
- const preset = cmd.presetId ? PRESETS.find(p => p.presetId === cmd.presetId) : matchPreset(cmd);
122
- if (preset?.presetId === 'shell' && (!cmd.command || (cmd.command === '/bin/zsh' && !existsSync('/bin/zsh')))) {
138
+ let preset = cmd.presetId ? PRESETS.find(p => p.presetId === cmd.presetId) : matchPreset(cmd);
139
+ if (isShellCommand(cmd, preset)) {
140
+ preset = PRESETS.find(p => p.presetId === 'shell') || preset;
141
+ cmd.presetId = 'shell';
142
+ cmd.label = cmd.label || 'Shell';
143
+ }
144
+ if (preset?.presetId === 'shell' && commandPathMissing(cmd.command)) {
123
145
  cmd.command = defaultShell;
124
146
  }
125
147
  // Stamp presetId for reliable lookup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clideck",
3
- "version": "1.30.7",
3
+ "version": "1.30.8",
4
4
  "description": "One screen for all your AI coding agents — run, monitor, and manage multiple CLI agents from a single browser tab",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -135,10 +135,17 @@ function ensureCommandForPreset(preset) {
135
135
  }
136
136
 
137
137
  function ensureShellCommand() {
138
- let cmd = state.cfg.commands.find(c => c.presetId === 'shell' || (!c.isAgent && !c.presetId));
139
- if (cmd) return cmd;
140
138
  const shellPreset = state.presets.find(p => p.presetId === 'shell');
141
139
  const command = shellPreset?.command || state.cfg.defaultShell;
140
+ let cmd = state.cfg.commands.find(c => c.presetId === 'shell' || (!c.isAgent && !c.presetId && String(c.label || '').toLowerCase() === 'shell'));
141
+ if (cmd) {
142
+ if (!cmd.command || (cmd.command === '/bin/zsh' && command && command !== '/bin/zsh')) {
143
+ cmd.presetId = 'shell';
144
+ cmd.command = command;
145
+ send({ type: 'config.update', config: state.cfg });
146
+ }
147
+ return cmd;
148
+ }
142
149
  if (!command) return null;
143
150
  cmd = {
144
151
  id: crypto.randomUUID(),