yolont 0.3.0 โ 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/README.md +2 -0
- package/dist/cli.js +22 -7
- package/dist/cli.js.map +2 -2
- package/docs/GUIDE.md +6 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
rules, looks harder where mistakes hurt, scores every MR/PR 0โ100, and learns when you tell it
|
|
5
5
|
it's wrong.
|
|
6
6
|
|
|
7
|
+
๐ **[srcgrp.dev/yolont](https://srcgrp.dev/yolont)** ยท ๐ [Guide](docs/GUIDE.md) ยท ๐ฆ [npm](https://www.npmjs.com/package/yolont)
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
cd ~/code/your-project
|
|
9
11
|
npx yolont
|
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
|
];
|
|
@@ -6144,6 +6152,13 @@ function parseAddress(s) {
|
|
|
6144
6152
|
const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(s.trim()) || s.includes("@") ? s : `https://${s.trim()}`;
|
|
6145
6153
|
return parseGitAddress(withScheme, gitlabBases2());
|
|
6146
6154
|
}
|
|
6155
|
+
function describeFetchError(err) {
|
|
6156
|
+
const e = err;
|
|
6157
|
+
const cause = e.cause?.code ?? e.cause?.message;
|
|
6158
|
+
if (!cause) return e.message;
|
|
6159
|
+
const hint = /ENOTFOUND|EAI_AGAIN/.test(cause) ? "the host name doesn't resolve" : /ETIMEDOUT|UND_ERR_CONNECT_TIMEOUT/.test(cause) ? "no answer (blocked, or needs a VPN?)" : /ECONNREFUSED|ECONNRESET/.test(cause) ? "the connection was refused or dropped" : /SSL|TLS|CERT/i.test(cause) ? "the secure connection was refused (often a VPN/proxy or a region block)" : "";
|
|
6160
|
+
return `${e.message} (${cause}${hint ? `: ${hint}` : ""}). Can you open the host in a browser from this machine?`;
|
|
6161
|
+
}
|
|
6147
6162
|
async function forgeStep(detected, raw, change) {
|
|
6148
6163
|
let address = detected;
|
|
6149
6164
|
let last = raw ?? "";
|
|
@@ -6189,7 +6204,7 @@ ${type === "github" ? "Scope: repo (or fine-grained: Pull requests + Issues read
|
|
|
6189
6204
|
const ok = await testForge(forge, address.projectPath);
|
|
6190
6205
|
s.stop(`Signed in as ${pc3.bold(ok.username)} \xB7 ${ok.pathWithNamespace}`);
|
|
6191
6206
|
} catch (err) {
|
|
6192
|
-
s.stop(pc3.red(`Check failed: ${err
|
|
6207
|
+
s.stop(pc3.red(`Check failed: ${describeFetchError(err)}`));
|
|
6193
6208
|
const next = await ask(
|
|
6194
6209
|
select2({
|
|
6195
6210
|
message: "What now?",
|