yolont 0.3.1 → 0.4.0
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 +14 -6
- package/dist/cli.js.map +2 -2
- package/docs/GUIDE.md +4 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1396,6 +1396,14 @@ var OpenCodeZenProvider = class {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
opts;
|
|
1398
1398
|
sessionId;
|
|
1399
|
+
/** Errors name the host the request went to (api.openai.com, opencode.ai, …), not a fixed brand. */
|
|
1400
|
+
get label() {
|
|
1401
|
+
try {
|
|
1402
|
+
return new URL(this.opts.baseUrl ?? "https://opencode.ai/zen/v1").host;
|
|
1403
|
+
} catch {
|
|
1404
|
+
return "LLM gateway";
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1399
1407
|
async review(input) {
|
|
1400
1408
|
const schema = buildReviewJsonSchema(input.categories.map((c) => c.name), input.zones?.map((h) => h.zone.id), !!input.reviewerFocus);
|
|
1401
1409
|
const { toolCallArgs, content } = await this.stream({
|
|
@@ -1416,13 +1424,13 @@ var OpenCodeZenProvider = class {
|
|
|
1416
1424
|
});
|
|
1417
1425
|
const raw = toolCallArgs || content;
|
|
1418
1426
|
if (!raw) {
|
|
1419
|
-
throw new LlmParseError(
|
|
1427
|
+
throw new LlmParseError(`${this.label} response had neither a tool call nor message content`);
|
|
1420
1428
|
}
|
|
1421
1429
|
let json;
|
|
1422
1430
|
try {
|
|
1423
1431
|
json = JSON.parse(raw);
|
|
1424
1432
|
} catch (err) {
|
|
1425
|
-
throw new LlmParseError(
|
|
1433
|
+
throw new LlmParseError(`${this.label} response was not valid JSON: ${err.message}`, raw);
|
|
1426
1434
|
}
|
|
1427
1435
|
const parsed = LlmReviewResponseSchema.safeParse(json);
|
|
1428
1436
|
if (!parsed.success) {
|
|
@@ -1432,7 +1440,7 @@ var OpenCodeZenProvider = class {
|
|
|
1432
1440
|
}
|
|
1433
1441
|
async complete(prompt) {
|
|
1434
1442
|
const { content } = await this.stream({ model: this.opts.model, stream: true, messages: [{ role: "user", content: prompt }] });
|
|
1435
|
-
if (!content) throw new LlmParseError(
|
|
1443
|
+
if (!content) throw new LlmParseError(`${this.label} response had no message content`);
|
|
1436
1444
|
return content;
|
|
1437
1445
|
}
|
|
1438
1446
|
/** POSTs a streamed chat completion; returns the concatenated tool-call args and message content (reasoning deltas ignored). */
|
|
@@ -1451,7 +1459,7 @@ var OpenCodeZenProvider = class {
|
|
|
1451
1459
|
body: JSON.stringify(body)
|
|
1452
1460
|
});
|
|
1453
1461
|
if (!res.ok) {
|
|
1454
|
-
throw new LlmParseError(
|
|
1462
|
+
throw new LlmParseError(`${this.label} request failed: ${res.status} ${await res.text()}`);
|
|
1455
1463
|
}
|
|
1456
1464
|
let toolCallArgs = "";
|
|
1457
1465
|
let content = "";
|
|
@@ -4940,9 +4948,9 @@ function removeForge(host) {
|
|
|
4940
4948
|
}
|
|
4941
4949
|
var PROVIDER_PRESETS = [
|
|
4942
4950
|
{ label: "Anthropic (Claude API)", provider: "anthropic", name: "anthropic", model: "claude-opus-5-5", hint: "or claude-sonnet-5-5 \u2014 cheaper" },
|
|
4943
|
-
{ label: "OpenCode
|
|
4951
|
+
{ label: "OpenCode", provider: "openai-compatible", name: "opencode", baseUrl: "https://opencode.ai/zen/v1", model: "deepseek-v4.1-flash", hint: "formerly Zen \xB7 key from opencode.ai/console" },
|
|
4944
4952
|
{ label: "OpenRouter", provider: "openai-compatible", name: "openrouter", baseUrl: "https://openrouter.ai/api/v1" },
|
|
4945
|
-
{ label: "OpenAI", provider: "openai-compatible", name: "openai", baseUrl: "https://api.openai.com/v1" },
|
|
4953
|
+
{ label: "OpenAI", provider: "openai-compatible", name: "openai", baseUrl: "https://api.openai.com/v1", hint: "an OpenAI model id (gpt-\u2026), not another gateway's" },
|
|
4946
4954
|
{ label: "Other OpenAI-compatible gateway", provider: "openai-compatible", name: "gateway" },
|
|
4947
4955
|
{ label: "Ollama (local, offline)", provider: "ollama", name: "ollama", baseUrl: "http://localhost:11434", model: "qwen2.5-coder", hint: "no key" }
|
|
4948
4956
|
];
|