@sylphx/flow 1.0.6 → 1.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5b1adfb: Fix missing runtime dependencies in package.json
8
+
9
+ Add missing dependencies that are required when the package is installed globally:
10
+
11
+ - react and ink (for UI components)
12
+ - drizzle-orm and @libsql/client (for database operations)
13
+ - @modelcontextprotocol/sdk (for MCP features)
14
+ - @lancedb/lancedb (for vector storage)
15
+ - @huggingface/transformers (for tokenization)
16
+ - chokidar (for file watching)
17
+ - ignore (for gitignore parsing)
18
+ - ai (for AI SDK features)
19
+
20
+ This fixes the error: "Cannot find module 'react/jsx-dev-runtime'" when running sylphx-flow -v after global installation.
21
+
22
+ ## 1.1.0
23
+
24
+ ### Minor Changes
25
+
26
+ - 7fdb9f2: Simplify provider selection - always ask, never save defaults
27
+
28
+ **Breaking Change**: Removed smart defaults for provider/agent selection
29
+
30
+ **Before:**
31
+
32
+ - Initial setup saved default provider
33
+ - Runtime choices were automatically saved
34
+ - Smart defaults applied on next run
35
+ - Complex conditional logic with useDefaults flags
36
+
37
+ **After:**
38
+
39
+ - Initial setup only configures API keys
40
+ - Always prompts for provider/agent each run
41
+ - No automatic saving of runtime choices
42
+ - Simple: want to skip prompts? Use `--provider` / `--agent` args
43
+
44
+ **Migration:**
45
+ Users who relied on saved defaults should now:
46
+
47
+ - Use `--provider default --agent coder` in scripts
48
+ - Or accept the prompt on each run
49
+
50
+ **Example:**
51
+
52
+ ```bash
53
+ # Always prompts (new default behavior)
54
+ sylphx-flow "your prompt"
55
+
56
+ # Skip prompts with args
57
+ sylphx-flow --provider default --agent coder "your prompt"
58
+ ```
59
+
60
+ This change reduces code complexity by 155 lines and makes behavior more predictable.
61
+
3
62
  ## 1.0.6
4
63
 
5
64
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.0.6",
3
+ "version": "1.1.1",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,7 +27,17 @@
27
27
  "gray-matter": "^4.0.3",
28
28
  "yaml": "^2.8.1",
29
29
  "zod": "^4.1.12",
30
- "debug": "^4.4.3"
30
+ "debug": "^4.4.3",
31
+ "react": "^19.2.0",
32
+ "ink": "^6.4.0",
33
+ "drizzle-orm": "^0.44.7",
34
+ "@modelcontextprotocol/sdk": "^1.21.0",
35
+ "@libsql/client": "^0.15.15",
36
+ "@lancedb/lancedb": "^0.22.2",
37
+ "@huggingface/transformers": "^3.7.6",
38
+ "chokidar": "^4.0.3",
39
+ "ignore": "^7.0.5",
40
+ "ai": "^5.0.88"
31
41
  },
32
42
  "devDependencies": {
33
43
  "@types/node": "^24.9.2",
package/src/index.ts CHANGED
File without changes
@@ -79,7 +79,7 @@ export class SmartConfigService {
79
79
  });
80
80
  }
81
81
 
82
- // Mark setup as completed (no need for default preferences prompt)
82
+ // Mark setup as completed (only save API keys, no defaults)
83
83
  await ConfigService.saveHomeSettings({ hasCompletedSetup: true });
84
84
  console.log(chalk.green('\n✓ Setup complete!\n'));
85
85
  }
@@ -113,99 +113,14 @@ export class SmartConfigService {
113
113
  await ConfigService.saveHomeSettings({ apiKeys: existingApiKeys });
114
114
  }
115
115
 
116
- /**
117
- * Setup default preferences
118
- */
119
- private static async setupDefaultPreferences(): Promise<void> {
120
- console.log(chalk.cyan('⚙️ Setup Default Preferences\n'));
121
-
122
- const userSettings = await ConfigService.loadHomeSettings();
123
- const availableProviders = ConfigService.getAvailableProviders(userSettings);
124
-
125
- if (availableProviders.length === 0) {
126
- console.log(chalk.yellow('⚠ No API keys configured yet. Skipping preferences setup.'));
127
- return;
128
- }
129
-
130
- const { setupDefaults } = await inquirer.prompt([
131
- {
132
- type: 'confirm',
133
- name: 'setupDefaults',
134
- message: 'Set up default preferences?',
135
- default: true,
136
- },
137
- ]);
138
-
139
- if (!setupDefaults) {
140
- console.log(chalk.dim('Skipping preferences setup.'));
141
- return;
142
- }
143
-
144
- // Select default provider
145
- if (availableProviders.length > 1) {
146
- const { defaultProvider } = await inquirer.prompt([
147
- {
148
- type: 'list',
149
- name: 'defaultProvider',
150
- message: 'Select default provider:',
151
- choices: availableProviders.map(p => ({
152
- name: p.charAt(0).toUpperCase() + p.slice(1),
153
- value: p,
154
- })),
155
- default: userSettings.defaultProvider || availableProviders[0],
156
- },
157
- ]);
158
-
159
- userSettings.defaultProvider = defaultProvider;
160
- }
161
-
162
- // Set default agent (will use dynamic loading)
163
- const { useDefaultAgent } = await inquirer.prompt([
164
- {
165
- type: 'confirm',
166
- name: 'useDefaultAgent',
167
- message: 'Set default agent?',
168
- default: true,
169
- },
170
- ]);
171
-
172
- if (useDefaultAgent) {
173
- try {
174
- const agents = await loadAllAgents(process.cwd());
175
- if (agents.length > 0) {
176
- const { defaultAgent } = await inquirer.prompt([
177
- {
178
- type: 'list',
179
- name: 'defaultAgent',
180
- message: 'Select default agent:',
181
- choices: agents.map(a => ({
182
- name: a.metadata.name || a.id,
183
- value: a.id,
184
- })),
185
- default: userSettings.defaultAgent || (agents.find(a => a.id === 'coder')?.id || agents[0].id),
186
- },
187
- ]);
188
-
189
- userSettings.defaultAgent = defaultAgent;
190
- }
191
- } catch (error) {
192
- console.log(chalk.yellow('⚠ Could not load agents, using "coder" as default'));
193
- userSettings.defaultAgent = 'coder';
194
- }
195
- }
196
-
197
- await ConfigService.saveHomeSettings(userSettings);
198
- console.log(chalk.green('✓ Default preferences saved'));
199
- }
200
116
 
201
117
  /**
202
118
  * Runtime selection - choose provider and agent for this run
203
119
  *
204
- * DESIGN PRINCIPLE: Smart Defaults
205
- * - Has saved default → Use it (no prompt)
206
- * - No saved default Prompt user
207
- * - Explicit flag (--select-provider/--select-agent) Force prompt (override)
208
- * - Explicit option (--provider/--agent) → Use specified value
120
+ * DESIGN PRINCIPLE: Always Ask (Simple & Explicit)
121
+ * - Has args (--provider/--agent) → Use them directly
122
+ * - No argsAlways prompt user
123
+ * - Never save runtime choices as defaults
209
124
  */
210
125
  static async selectRuntimeChoices(options: SmartConfigOptions): Promise<RuntimeChoices> {
211
126
  const config = await ConfigService.loadConfiguration();
@@ -213,42 +128,22 @@ export class SmartConfigService {
213
128
 
214
129
  // Handle provider selection
215
130
  if (options.provider) {
216
- // 1. Explicit option provided
131
+ // Explicit option provided via args
217
132
  choices.provider = options.provider;
218
- } else if (options.selectProvider) {
219
- // 2. Force selection (override defaults)
220
- choices.provider = await this.selectProvider(config.user);
221
- } else if (config.user.defaultProvider) {
222
- // 3. Use saved default (SMART DEFAULT - no prompt needed)
223
- choices.provider = config.user.defaultProvider;
224
- console.log(chalk.dim(` ✓ Provider: ${choices.provider}`));
225
133
  } else {
226
- // 4. No default saved, must prompt
134
+ // Always prompt
227
135
  choices.provider = await this.selectProvider(config.user);
228
136
  }
229
137
 
230
138
  // Handle agent selection
231
139
  if (options.agent) {
232
- // 1. Explicit option provided
140
+ // Explicit option provided via args
233
141
  choices.agent = options.agent;
234
- } else if (options.selectAgent) {
235
- // 2. Force selection (override defaults)
236
- choices.agent = await this.selectAgent(config.user.defaultAgent);
237
- } else if (config.user.defaultAgent) {
238
- // 3. Use saved default (SMART DEFAULT - no prompt needed)
239
- choices.agent = config.user.defaultAgent;
240
- console.log(chalk.dim(` ✓ Agent: ${choices.agent}`));
241
142
  } else {
242
- // 4. No default saved, must prompt
243
- choices.agent = await this.selectAgent(config.user.defaultAgent);
143
+ // Always prompt
144
+ choices.agent = await this.selectAgent();
244
145
  }
245
146
 
246
- // Save choices for next time
247
- await ConfigService.saveHomeSettings({
248
- defaultProvider: choices.provider,
249
- defaultAgent: choices.agent,
250
- });
251
-
252
147
  return choices;
253
148
  }
254
149
 
@@ -265,22 +160,16 @@ export class SmartConfigService {
265
160
  { id: 'z.ai', name: 'Z.ai (Recommended)', hasKey: !!apiKeys['z.ai'] },
266
161
  ];
267
162
 
268
- // Show last used provider hint
269
- const lastUsed = userSettings.defaultProvider;
270
- const message = lastUsed
271
- ? `Select provider (last used: ${lastUsed}):`
272
- : 'Select provider:';
273
-
274
163
  const { provider } = await inquirer.prompt([
275
164
  {
276
165
  type: 'list',
277
166
  name: 'provider',
278
- message,
167
+ message: 'Select provider:',
279
168
  choices: allProviders.map(p => ({
280
169
  name: p.hasKey ? p.name : `${p.name} (Need API key)`,
281
170
  value: p.id,
282
171
  })),
283
- default: lastUsed || 'default',
172
+ default: 'default',
284
173
  },
285
174
  ]);
286
175
 
@@ -309,7 +198,7 @@ export class SmartConfigService {
309
198
  /**
310
199
  * Select agent for this run
311
200
  */
312
- private static async selectAgent(lastUsed?: string): Promise<string> {
201
+ private static async selectAgent(): Promise<string> {
313
202
  try {
314
203
  const agents = await loadAllAgents(process.cwd());
315
204
 
@@ -318,21 +207,16 @@ export class SmartConfigService {
318
207
  return 'coder';
319
208
  }
320
209
 
321
- // Build message with last used hint
322
- const message = lastUsed
323
- ? `Select agent (last used: ${lastUsed}):`
324
- : 'Select agent:';
325
-
326
210
  const { agent } = await inquirer.prompt([
327
211
  {
328
212
  type: 'list',
329
213
  name: 'agent',
330
- message,
214
+ message: 'Select agent:',
331
215
  choices: agents.map(a => ({
332
216
  name: a.metadata.name || a.id,
333
217
  value: a.id,
334
218
  })),
335
- default: lastUsed || agents.find(a => a.id === 'coder')?.id || agents[0].id,
219
+ default: agents.find(a => a.id === 'coder')?.id || agents[0].id,
336
220
  },
337
221
  ]);
338
222