@askalf/dario 2.9.1 → 2.9.2

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.
Files changed (2) hide show
  1. package/dist/proxy.js +12 -2
  2. package/package.json +1 -1
package/dist/proxy.js CHANGED
@@ -469,8 +469,18 @@ async function handleViaCli(body, model, verbose) {
469
469
  : JSON.stringify(lastUser.content);
470
470
  // Build claude --print command
471
471
  const args = ['--print', '--model', effectiveModel];
472
- // Build system prompt from messages context
473
- let systemPrompt = parsed.system ?? '';
472
+ // Flatten system prompt API accepts string or array of content blocks,
473
+ // but claude --print only accepts a string
474
+ let systemPrompt = '';
475
+ if (typeof parsed.system === 'string') {
476
+ systemPrompt = parsed.system;
477
+ }
478
+ else if (Array.isArray(parsed.system)) {
479
+ systemPrompt = parsed.system
480
+ .filter(b => b.text)
481
+ .map(b => b.text)
482
+ .join('\n\n');
483
+ }
474
484
  // Include conversation history as context
475
485
  const history = messages.slice(0, -1);
476
486
  if (history.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "2.9.1",
3
+ "version": "2.9.2",
4
4
  "description": "Use your Claude subscription as an API. No API key needed. Local proxy for Claude Max/Pro subscriptions.",
5
5
  "type": "module",
6
6
  "bin": {