threewzrd 1.0.3 → 1.0.5

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/dist/cli.js CHANGED
@@ -23,7 +23,7 @@ program
23
23
  .command('start')
24
24
  .description('Start the wizard REPL')
25
25
  .option('-d, --directory <path>', 'Working directory for the wizard', safeGetCwd())
26
- .option('-m, --model <model>', 'Model to use (sonnet, opus, haiku, opus-4.6)')
26
+ .option('-m, --model <model>', 'Model to use (sonnet, opus, haiku, opus-4.5, opus-4.6)')
27
27
  .action(startCommand);
28
28
  program
29
29
  .command('config')
@@ -5,7 +5,7 @@ import chalk from 'chalk';
5
5
  import { MODEL_MAP, DEFAULT_MODEL } from '../core/types.js';
6
6
  const CONFIG_DIR = join(homedir(), '.threewzrd');
7
7
  const CONFIG_PATH = join(CONFIG_DIR, 'config.json');
8
- const VALID_MODELS = ['sonnet', 'opus', 'haiku', 'opus-4.6'];
8
+ const VALID_MODELS = ['sonnet', 'opus', 'haiku', 'opus-4.5', 'opus-4.6'];
9
9
  async function loadConfig() {
10
10
  try {
11
11
  const content = await readFile(CONFIG_PATH, 'utf-8');
@@ -5,7 +5,7 @@ import { mkdir, writeFile, readFile } from 'fs/promises';
5
5
  import * as readline from 'readline';
6
6
  import chalk from 'chalk';
7
7
  import { ThreeJsWizard } from '../core/ThreeJsWizard.js';
8
- const VALID_MODELS = ['sonnet', 'opus', 'haiku', 'opus-4.6'];
8
+ const VALID_MODELS = ['sonnet', 'opus', 'haiku', 'opus-4.5', 'opus-4.6'];
9
9
  async function getConfiguredModel() {
10
10
  try {
11
11
  const configPath = join(homedir(), '.threewzrd', 'config.json');
@@ -103,16 +103,16 @@ export class ThreeJsWizard {
103
103
  case 'model':
104
104
  if (args.length === 0) {
105
105
  this.ui.printInfo(`Current model: ${this.engine.getModel()}`);
106
- this.ui.printInfo('Available models: sonnet, opus, haiku, opus-4.6');
106
+ this.ui.printInfo('Available models: sonnet, opus, haiku, opus-4.5, opus-4.6');
107
107
  }
108
108
  else {
109
109
  const modelName = args[0].toLowerCase();
110
- if (['sonnet', 'opus', 'haiku', 'opus-4.6'].includes(modelName)) {
110
+ if (['sonnet', 'opus', 'haiku', 'opus-4.5', 'opus-4.6'].includes(modelName)) {
111
111
  this.engine.setModel(modelName);
112
112
  this.ui.printModelSwitch(modelName);
113
113
  }
114
114
  else {
115
- this.ui.printError(`Unknown model: ${modelName}. Use: sonnet, opus, haiku, or opus-4.6`);
115
+ this.ui.printError(`Unknown model: ${modelName}. Use: sonnet, opus, haiku, opus-4.5, or opus-4.6`);
116
116
  }
117
117
  }
118
118
  break;
@@ -1,5 +1,5 @@
1
1
  import Anthropic from '@anthropic-ai/sdk';
2
- export type ModelId = 'sonnet' | 'opus' | 'haiku' | 'opus-4.6';
2
+ export type ModelId = 'sonnet' | 'opus' | 'haiku' | 'opus-4.5' | 'opus-4.6';
3
3
  export declare const MODEL_MAP: Record<ModelId, string>;
4
4
  export declare const DEFAULT_MODEL: ModelId;
5
5
  export type ProjectLanguage = 'javascript' | 'typescript';
@@ -2,6 +2,7 @@ export const MODEL_MAP = {
2
2
  sonnet: 'claude-sonnet-4-20250514',
3
3
  opus: 'claude-opus-4-20250514',
4
4
  haiku: 'claude-haiku-4-20250514',
5
+ 'opus-4.5': 'claude-opus-4-5-20251101',
5
6
  'opus-4.6': 'claude-opus-4-6-20260201',
6
7
  };
7
- export const DEFAULT_MODEL = 'opus-4.6';
8
+ export const DEFAULT_MODEL = 'opus-4.5';
@@ -64,12 +64,29 @@ export class ToolExecutor {
64
64
  if (typeof obj.path !== 'string' || !obj.path.trim()) {
65
65
  throw new Error('Invalid input: path must be a non-empty string');
66
66
  }
67
- if (typeof obj.content !== 'string') {
68
- throw new Error('Invalid input: content must be a string');
67
+ // Coerce content to string - handle various types the model might return
68
+ let content;
69
+ if (typeof obj.content === 'string') {
70
+ content = obj.content;
71
+ }
72
+ else if (obj.content === null || obj.content === undefined) {
73
+ content = '';
74
+ }
75
+ else if (Array.isArray(obj.content)) {
76
+ // Model sometimes returns content as an array of strings
77
+ content = obj.content.map(item => String(item)).join('\n');
78
+ }
79
+ else if (typeof obj.content === 'object') {
80
+ // Fallback: stringify objects
81
+ content = JSON.stringify(obj.content, null, 2);
82
+ }
83
+ else {
84
+ // Fallback for numbers, booleans, etc.
85
+ content = String(obj.content);
69
86
  }
70
87
  return {
71
88
  path: obj.path.trim(),
72
- content: obj.content,
89
+ content,
73
90
  skipValidation: obj.skipValidation === true
74
91
  };
75
92
  }
@@ -110,6 +110,7 @@ export class TerminalUI {
110
110
  sonnet: 'Claude Sonnet 4',
111
111
  opus: 'Claude Opus 4',
112
112
  haiku: 'Claude Haiku 4',
113
+ 'opus-4.5': 'Claude Opus 4.5',
113
114
  'opus-4.6': 'Claude Opus 4.6',
114
115
  };
115
116
  console.log(chalk.green(`Switched to ${modelNames[model]}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threewzrd",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "AI-powered CLI for generating Three.js projects from natural language",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {