@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.
- package/dist/proxy.js +12 -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
|
-
//
|
|
473
|
-
|
|
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) {
|