claude-code-templates 1.24.7 → 1.24.9

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.
@@ -244,14 +244,21 @@ Requirements:
244
244
  // Collect the full response
245
245
  let generatedCode = '';
246
246
 
247
- for await (const message of query({ prompt: promptContent, options })) {
248
- if (message.type === 'text') {
249
- generatedCode += message.text;
247
+ try {
248
+ for await (const message of query({ prompt: promptContent, options })) {
249
+ if (message.type === 'text') {
250
+ generatedCode += message.text;
251
+ }
250
252
  }
253
+ } catch (queryError) {
254
+ const err = queryError as Error;
255
+ log(`Query error: ${err.message}`, 'error');
256
+ log(`Stack: ${err.stack}`, 'error');
257
+ throw new Error(`Claude Agent SDK query failed: ${err.message}`);
251
258
  }
252
259
 
253
260
  if (!generatedCode) {
254
- throw new Error('Failed to generate code from Claude Agent SDK');
261
+ throw new Error('Failed to generate code from Claude Agent SDK (empty response)');
255
262
  }
256
263
 
257
264
  log('Code generated successfully', 'success');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-templates",
3
- "version": "1.24.7",
3
+ "version": "1.24.9",
4
4
  "description": "CLI tool to setup Claude Code configurations with framework-specific commands, automation hooks and MCP Servers for your projects",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -2679,10 +2679,22 @@ async function executeCloudflareSandbox(options, targetDir) {
2679
2679
  if (npmCode === 0) {
2680
2680
  depSpinner.succeed('Cloudflare dependencies installed successfully');
2681
2681
 
2682
+ // Build components string for installation inside sandbox
2683
+ let componentsToInstall = '';
2684
+ if (agent) componentsToInstall += ` --agent ${agent}`;
2685
+ if (command) componentsToInstall += ` --command ${command}`;
2686
+ if (mcp) componentsToInstall += ` --mcp ${mcp}`;
2687
+ if (setting) componentsToInstall += ` --setting ${setting}`;
2688
+ if (hook) componentsToInstall += ` --hook ${hook}`;
2689
+
2682
2690
  // Execute using launcher
2683
2691
  console.log(chalk.blue('🚀 Launching Cloudflare sandbox...'));
2684
2692
  console.log(chalk.gray(`📝 Prompt: "${prompt.substring(0, 100)}${prompt.length > 100 ? '...' : ''}"`));
2685
2693
 
2694
+ if (componentsToInstall) {
2695
+ console.log(chalk.gray(`📦 Components to install:${componentsToInstall}`));
2696
+ }
2697
+
2686
2698
  // Use ts-node or tsx to execute TypeScript launcher
2687
2699
  const launcherPath = path.join(sandboxDir, 'launcher.ts');
2688
2700
 
@@ -2692,7 +2704,7 @@ async function executeCloudflareSandbox(options, targetDir) {
2692
2704
  'tsx',
2693
2705
  launcherPath,
2694
2706
  prompt,
2695
- agent || '',
2707
+ componentsToInstall.trim(),
2696
2708
  anthropicKey,
2697
2709
  'http://localhost:8787', // Local dev server URL
2698
2710
  targetDir // Project root directory for file output