@blockrun/cc 0.8.0 → 0.8.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.
@@ -37,9 +37,20 @@ function detectModelSwitch(parsed) {
37
37
  if (!parsed.messages || parsed.messages.length === 0)
38
38
  return null;
39
39
  const last = parsed.messages[parsed.messages.length - 1];
40
- if (last.role !== 'user' || typeof last.content !== 'string')
40
+ if (last.role !== 'user')
41
41
  return null;
42
- const content = last.content.trim().toLowerCase();
42
+ let content = '';
43
+ if (typeof last.content === 'string') {
44
+ content = last.content;
45
+ }
46
+ else if (Array.isArray(last.content)) {
47
+ const textBlock = last.content.find(b => b.type === 'text' && b.text);
48
+ if (textBlock && textBlock.text)
49
+ content = textBlock.text;
50
+ }
51
+ if (!content)
52
+ return null;
53
+ content = content.trim().toLowerCase();
43
54
  const match = content.match(/^use\s+(.+)$/);
44
55
  if (!match)
45
56
  return null;
@@ -86,6 +97,10 @@ export function createProxy(options) {
86
97
  try {
87
98
  const parsed = JSON.parse(body);
88
99
  // Intercept "use <model>" commands for in-session model switching
100
+ if (parsed.messages) {
101
+ const last = parsed.messages[parsed.messages.length - 1];
102
+ debug(options, `last msg role=${last?.role} content-type=${typeof last?.content} content=${JSON.stringify(last?.content).slice(0, 200)}`);
103
+ }
89
104
  const switchCmd = detectModelSwitch(parsed);
90
105
  if (switchCmd) {
91
106
  currentModel = switchCmd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/cc",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Run Claude Code with any model — no rate limits, no account locks, no phone verification. Pay per use with USDC.",
5
5
  "type": "module",
6
6
  "bin": {