fecode-cli 1.1.1 → 1.1.3
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 +10 -3
- package/dist/error-D4a-8BXd.js +56 -0
- package/dist/error-qAR8Lv-R.js +57 -0
- package/dist/index.js +1 -17196
- package/dist/node.browser-7pW7d9_e.js +46 -0
- package/dist/node.browser-B5CfqNxN.js +46 -0
- package/dist/node.browser-BWLpZywP.js +46 -0
- package/dist/node.browser-BraUi2yf.js +9 -0
- package/dist/node.browser-BsGbhAIw.js +46 -0
- package/dist/node.browser-C9Wg-Fje.js +46 -0
- package/dist/node.browser-CADgAblr.js +46 -0
- package/dist/node.browser-Cse19Rko.js +47 -0
- package/dist/node.browser-Cx8sZi1Z.js +46 -0
- package/dist/node.browser-DtPNhPGQ.js +46 -0
- package/dist/node.browser-DvjMZMaq.js +46 -0
- package/dist/node.browser-EewJmuUw.js +46 -0
- package/dist/node.browser-J7voHtuR.js +10 -0
- package/dist/src-4fKRO0jn.js +31655 -0
- package/dist/src-8kA-5Kbs.js +31591 -0
- package/dist/src-B_Z8CdqT.js +31556 -0
- package/dist/src-Bhec3XmL.js +31574 -0
- package/dist/src-C8Oe06wn.js +31580 -0
- package/dist/src-CxriUNOE.js +31556 -0
- package/dist/src-D78uLcuc.js +31573 -0
- package/dist/src-DBoGZaxi.js +31533 -0
- package/dist/src-EyWDnffN.js +31636 -0
- package/dist/src-dhvwrHAJ.js +31590 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E=20.0.0-brightgreen.svg" alt="Node.js version" /></a>
|
|
12
12
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/typescript-strict%205.7+-blue.svg" alt="TypeScript Strict" />
|
|
14
|
-
<img src="https://img.shields.io/badge/tests-
|
|
15
|
-
<img src="https://img.shields.io/badge/version-1.1.
|
|
14
|
+
<img src="https://img.shields.io/badge/tests-1470%20passed-success.svg" alt="Tests" />
|
|
15
|
+
<img src="https://img.shields.io/badge/version-1.1.3-brightgreen.svg" alt="Version 1.1.3" />
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
18
|
---
|
|
@@ -191,6 +191,11 @@ export FE_PROVIDER="openai-compatible"
|
|
|
191
191
|
export FE_MODEL="deepseek-ai/deepseek-v4.1-flash"
|
|
192
192
|
export OPENAI_API_KEY="your-nvidia-api-key"
|
|
193
193
|
export OPENAI_BASE_URL="https://integrate.api.nvidia.com/v1"
|
|
194
|
+
|
|
195
|
+
# Option 5: Anthropic Claude
|
|
196
|
+
export FE_PROVIDER="anthropic"
|
|
197
|
+
export FE_MODEL="claude-sonnet-5-5"
|
|
198
|
+
export ANTHROPIC_API_KEY="your-anthropic-api-key"
|
|
194
199
|
```
|
|
195
200
|
|
|
196
201
|
### 2. Launch FeCode
|
|
@@ -232,10 +237,11 @@ CLI Flags ──▶ Environment Variables ──▶ Workspace .env ──
|
|
|
232
237
|
|
|
233
238
|
| Variable | Description | Default |
|
|
234
239
|
| :--- | :--- | :--- |
|
|
235
|
-
| `FE_PROVIDER` | LLM provider backend (`gemini`, `openai`, `ollama`, `openai-compatible`) | `gemini` |
|
|
240
|
+
| `FE_PROVIDER` | LLM provider backend (`gemini`, `openai`, `anthropic`, `ollama`, `openai-compatible`) | `gemini` |
|
|
236
241
|
| `FE_MODEL` | Model name override | Provider-specific |
|
|
237
242
|
| `GEMINI_API_KEY` | API key for Google Gemini provider | None (Required for Gemini) |
|
|
238
243
|
| `OPENAI_API_KEY` | API key for OpenAI or OpenAI-compatible provider | None (Required for OpenAI / Compatible) |
|
|
244
|
+
| `ANTHROPIC_API_KEY` | API key for Anthropic Claude provider | None (Required for Anthropic) |
|
|
239
245
|
| `OPENAI_BASE_URL` | Base API endpoint for OpenAI or OpenAI-compatible services | Standard OpenAI API (`https://api.openai.com/v1`) |
|
|
240
246
|
| `OLLAMA_BASE_URL` | Base API endpoint for local Ollama daemon | `http://localhost:11434/v1` |
|
|
241
247
|
|
|
@@ -251,6 +257,7 @@ FeCode abstracts model providers behind a unified streaming interface in `@fecod
|
|
|
251
257
|
| :--- | :--- | :---: | :---: | :---: |
|
|
252
258
|
| **Google Gemini** | `gemini-2.5-flash`, `gemini-1.5-pro` | Yes | Yes | Cloud |
|
|
253
259
|
| **OpenAI** | `gpt-4o`, `gpt-4o-mini` | Yes | Yes | Cloud |
|
|
260
|
+
| **Anthropic Claude** | `claude-sonnet-5-5`, `claude-opus-5-5` | Yes | Yes | Cloud |
|
|
254
261
|
| **Generic OpenAI-Compatible** | `deepseek-ai/deepseek-v4.1-flash`, NVIDIA NIM, vLLM, etc. | Yes | Yes | Cloud / Self-Hosted |
|
|
255
262
|
| **Ollama** | `qwen2.5-coder`, `deepseek-coder` | Yes | Yes | **Local (100% Offline)** |
|
|
256
263
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ../../node_modules/@anthropic-ai/sdk/internal/errors.mjs
|
|
2
|
+
function e(e) {
|
|
3
|
+
return typeof e == "object" && !!e && ("name" in e && e.name === "AbortError" || "message" in e && String(e.message).includes("FetchRequestCanceledException"));
|
|
4
|
+
}
|
|
5
|
+
var t = (e) => {
|
|
6
|
+
if (e instanceof Error) return e;
|
|
7
|
+
if (typeof e == "object" && e) {
|
|
8
|
+
try {
|
|
9
|
+
let t = Object.prototype.toString.call(e);
|
|
10
|
+
if (t === "[object Error]" || t === "[object DOMException]") {
|
|
11
|
+
let t = Error(e.message, e.cause ? { cause: e.cause } : {});
|
|
12
|
+
return e.stack && (t.stack = e.stack), e.cause && !t.cause && (t.cause = e.cause), e.name && (t.name = e.name), t;
|
|
13
|
+
}
|
|
14
|
+
} catch {}
|
|
15
|
+
try {
|
|
16
|
+
return Error(JSON.stringify(e));
|
|
17
|
+
} catch {}
|
|
18
|
+
}
|
|
19
|
+
return Error(e);
|
|
20
|
+
}, n = /* @__PURE__ */ (() => {
|
|
21
|
+
class e extends Error {}
|
|
22
|
+
return e;
|
|
23
|
+
})(), r = class e extends n {
|
|
24
|
+
constructor(t, n, r, i, a) {
|
|
25
|
+
super(`${e.makeMessage(t, n, r)}`), this.status = t, this.headers = i, this.requestID = i?.get("request-id"), this.workspaceID = i?.get("anthropic-workspace-id"), this.error = n, this.type = a ?? null;
|
|
26
|
+
}
|
|
27
|
+
static makeMessage(e, t, n) {
|
|
28
|
+
let r = t?.message ? typeof t.message == "string" ? t.message : JSON.stringify(t.message) : t ? JSON.stringify(t) : n;
|
|
29
|
+
return e && r ? `${e} ${r}` : e ? `${e} status code (no body)` : r || "(no status code or body)";
|
|
30
|
+
}
|
|
31
|
+
static generate(n, r, i, o) {
|
|
32
|
+
if (!n || !o) return new a({
|
|
33
|
+
message: i,
|
|
34
|
+
cause: t(r)
|
|
35
|
+
});
|
|
36
|
+
let s = r, g = s?.error?.type;
|
|
37
|
+
return n === 400 ? new c(n, s, i, o, g) : n === 401 ? new l(n, s, i, o, g) : n === 403 ? new u(n, s, i, o, g) : n === 404 ? new d(n, s, i, o, g) : n === 409 ? new f(n, s, i, o, g) : n === 422 ? new p(n, s, i, o, g) : n === 429 ? new m(n, s, i, o, g) : n >= 500 ? new h(n, s, i, o, g) : new e(n, s, i, o, g);
|
|
38
|
+
}
|
|
39
|
+
}, i = class extends r {
|
|
40
|
+
constructor({ message: e } = {}) {
|
|
41
|
+
super(void 0, void 0, e || "Request was aborted.", void 0);
|
|
42
|
+
}
|
|
43
|
+
}, a = class extends r {
|
|
44
|
+
constructor({ message: e, cause: t }) {
|
|
45
|
+
super(void 0, void 0, e || "Connection error.", void 0), t && (this.cause = t);
|
|
46
|
+
}
|
|
47
|
+
}, o = class extends a {
|
|
48
|
+
constructor({ message: e } = {}) {
|
|
49
|
+
super({ message: e ?? "Request timed out." });
|
|
50
|
+
}
|
|
51
|
+
}, s = class extends n {
|
|
52
|
+
constructor(e, { cause: t } = {}) {
|
|
53
|
+
super(e ?? "Retryable error."), t !== void 0 && (this.cause = t);
|
|
54
|
+
}
|
|
55
|
+
}, c = class extends r {}, l = class extends r {}, u = class extends r {}, d = class extends r {}, f = class extends r {}, p = class extends r {}, m = class extends r {}, h = class extends r {};
|
|
56
|
+
export { n as a, f as c, u as d, m as f, e as g, t as h, i, h as l, p as m, o as n, l as o, s as p, r, c as s, a as t, d as u };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region ../../node_modules/@anthropic-ai/sdk/internal/errors.mjs
|
|
2
|
+
function e(e) {
|
|
3
|
+
return typeof e == "object" && !!e && ("name" in e && e.name === "AbortError" || "message" in e && String(e.message).includes("FetchRequestCanceledException"));
|
|
4
|
+
}
|
|
5
|
+
var t = (e) => {
|
|
6
|
+
if (e instanceof Error) return e;
|
|
7
|
+
if (typeof e == "object" && e) {
|
|
8
|
+
try {
|
|
9
|
+
let t = Object.prototype.toString.call(e);
|
|
10
|
+
if (t === "[object Error]" || t === "[object DOMException]") {
|
|
11
|
+
let t = Error(e.message, e.cause ? { cause: e.cause } : {});
|
|
12
|
+
return e.stack && (t.stack = e.stack), e.cause && !t.cause && (t.cause = e.cause), e.name && (t.name = e.name), t;
|
|
13
|
+
}
|
|
14
|
+
} catch {}
|
|
15
|
+
try {
|
|
16
|
+
return Error(JSON.stringify(e));
|
|
17
|
+
} catch {}
|
|
18
|
+
}
|
|
19
|
+
return Error(e);
|
|
20
|
+
}, n = /* @__PURE__ */ (() => {
|
|
21
|
+
class e extends Error {}
|
|
22
|
+
return e;
|
|
23
|
+
})(), r = class e extends n {
|
|
24
|
+
constructor(t, n, r, i, a) {
|
|
25
|
+
super(`${e.makeMessage(t, n, r)}`), this.status = t, this.headers = i, this.requestID = i?.get("request-id"), this.workspaceID = i?.get("anthropic-workspace-id"), this.error = n, this.type = a ?? null;
|
|
26
|
+
}
|
|
27
|
+
static makeMessage(e, t, n) {
|
|
28
|
+
let r = t?.message ? typeof t.message == "string" ? t.message : JSON.stringify(t.message) : t ? JSON.stringify(t) : n;
|
|
29
|
+
return e && r ? `${e} ${r}` : e ? `${e} status code (no body)` : r || "(no status code or body)";
|
|
30
|
+
}
|
|
31
|
+
static generate(n, r, i, o) {
|
|
32
|
+
if (!n || !o) return new a({
|
|
33
|
+
message: i,
|
|
34
|
+
cause: t(r)
|
|
35
|
+
});
|
|
36
|
+
let s = r, g = s?.error?.type;
|
|
37
|
+
return n === 400 ? new c(n, s, i, o, g) : n === 401 ? new l(n, s, i, o, g) : n === 403 ? new u(n, s, i, o, g) : n === 404 ? new d(n, s, i, o, g) : n === 409 ? new f(n, s, i, o, g) : n === 422 ? new p(n, s, i, o, g) : n === 429 ? new m(n, s, i, o, g) : n >= 500 ? new h(n, s, i, o, g) : new e(n, s, i, o, g);
|
|
38
|
+
}
|
|
39
|
+
}, i = class extends r {
|
|
40
|
+
constructor({ message: e } = {}) {
|
|
41
|
+
super(void 0, void 0, e || "Request was aborted.", void 0);
|
|
42
|
+
}
|
|
43
|
+
}, a = class extends r {
|
|
44
|
+
constructor({ message: e, cause: t }) {
|
|
45
|
+
super(void 0, void 0, e || "Connection error.", void 0), t && (this.cause = t);
|
|
46
|
+
}
|
|
47
|
+
}, o = class extends a {
|
|
48
|
+
constructor({ message: e } = {}) {
|
|
49
|
+
super({ message: e ?? "Request timed out." });
|
|
50
|
+
}
|
|
51
|
+
}, s = class extends n {
|
|
52
|
+
constructor(e, { cause: t } = {}) {
|
|
53
|
+
super(e ?? "Retryable error."), t !== void 0 && (this.cause = t);
|
|
54
|
+
}
|
|
55
|
+
}, c = class extends r {}, l = class extends r {}, u = class extends r {}, d = class extends r {}, f = class extends r {}, p = class extends r {}, m = class extends r {}, h = class extends r {};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { n as a, f as c, u as d, m as f, e as g, t as h, i, h as l, p as m, o as n, l as o, s as p, r, c as s, a as t, d as u };
|