@giovannijecha/jecode 0.1.9 → 0.2.1
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 +36 -18
- package/dist/account-lock.js +112 -0
- package/dist/accounts.js +100 -0
- package/dist/cli-info.js +2 -2
- package/dist/commands.js +1 -1
- package/dist/controller.js +46 -11
- package/dist/credential-commands.js +32 -4
- package/dist/credential-safety.js +10 -1
- package/dist/effort.js +25 -0
- package/dist/external-browser.js +53 -0
- package/dist/oauth-http.js +114 -0
- package/dist/openai-account-command.js +124 -0
- package/dist/openai-account.js +94 -0
- package/dist/openai-oauth-callback.js +186 -0
- package/dist/openai-oauth-tokens.js +65 -0
- package/dist/openai-oauth.js +203 -0
- package/dist/provider-commands.js +79 -38
- package/dist/provider-label.js +10 -0
- package/dist/providers/anthropic-stream.js +8 -2
- package/dist/providers/anthropic.js +22 -6
- package/dist/providers/index.js +2 -1
- package/dist/providers/ollama-stream.js +3 -0
- package/dist/providers/ollama.js +4 -1
- package/dist/providers/openai-codex.js +157 -0
- package/dist/providers/openai-stream.js +13 -9
- package/dist/providers/openai-wire.js +4 -9
- package/dist/providers/openai.js +36 -15
- package/dist/providers/sse.js +1 -1
- package/dist/settings-command.js +64 -9
- package/dist/settings.js +2 -1
- package/dist/tools/args.js +4 -3
- package/dist/tools/fs.js +8 -3
- package/dist/tools/index.js +2 -2
- package/dist/tools/shell.js +2 -0
- package/dist/tui/app-workflows.js +5 -0
- package/dist/tui/components/messages.js +26 -5
- package/dist/tui/feedback.js +10 -6
- package/dist/tui/session-view.js +10 -4
- package/dist/tui/turn.js +4 -1
- package/dist/version.js +14 -0
- package/docs/assets/brand/jeco-256.png +0 -0
- package/package.json +5 -1
package/dist/tui/feedback.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Operational feedback belongs in the footer, not in the conversation.
|
|
2
|
+
import { providerLabel } from "../provider-label.js";
|
|
2
3
|
const INFO_MS = 2_200;
|
|
3
4
|
const WARN_MS = 4_200;
|
|
4
5
|
const ERROR_MS = 6_000;
|
|
@@ -50,23 +51,26 @@ export function commandFeedback(block) {
|
|
|
50
51
|
/** Explain why a model turn cannot start, without exposing configuration internals. */
|
|
51
52
|
export function turnBlocker(session) {
|
|
52
53
|
const blocked = session.provider.blocked();
|
|
53
|
-
|
|
54
|
+
const auth = session.provider.auth;
|
|
55
|
+
const expected = auth.kind === "api-key"
|
|
56
|
+
? blocked?.startsWith(`${auth.keyVar} `) === true
|
|
57
|
+
: blocked !== undefined;
|
|
58
|
+
if (blocked !== undefined && !expected) {
|
|
54
59
|
return { text: blocked, tone: "error" };
|
|
55
60
|
}
|
|
56
61
|
if (blocked !== undefined) {
|
|
57
62
|
return {
|
|
58
|
-
text:
|
|
63
|
+
text: auth.kind === "oauth"
|
|
64
|
+
? `${providerLabel(session.provider.id)} needs ${auth.label} sign-in · /settings`
|
|
65
|
+
: `${providerLabel(session.provider.id)} needs an API key · /settings`,
|
|
59
66
|
tone: "warn",
|
|
60
67
|
};
|
|
61
68
|
}
|
|
62
69
|
if (session.model === "") {
|
|
63
70
|
return {
|
|
64
|
-
text: `${
|
|
71
|
+
text: `${providerLabel(session.provider.id)} needs a model · /models`,
|
|
65
72
|
tone: "warn",
|
|
66
73
|
};
|
|
67
74
|
}
|
|
68
75
|
return undefined;
|
|
69
76
|
}
|
|
70
|
-
function providerName(id) {
|
|
71
|
-
return id === "" ? "Provider" : `${id[0]?.toUpperCase() ?? ""}${id.slice(1)}`;
|
|
72
|
-
}
|
package/dist/tui/session-view.js
CHANGED
|
@@ -26,10 +26,16 @@ export function turnFailure(session, error, aborted) {
|
|
|
26
26
|
return { kind: "notice", text: "[interrupted]", tone: "warn" };
|
|
27
27
|
let text = providerFailure(session.provider, error);
|
|
28
28
|
if (/\b401\b/.test(text)) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const auth = session.provider.auth;
|
|
30
|
+
if (auth.kind === "oauth") {
|
|
31
|
+
text += ` · reconnect ${auth.label} in /settings`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const source = credentialSource(auth.keyVar);
|
|
35
|
+
text += source === "environment"
|
|
36
|
+
? ` · update ${auth.keyVar} in the environment and restart`
|
|
37
|
+
: " · check credentials with /settings";
|
|
38
|
+
}
|
|
33
39
|
}
|
|
34
40
|
return { kind: "notice", text, tone: "error" };
|
|
35
41
|
}
|
package/dist/tui/turn.js
CHANGED
|
@@ -110,7 +110,10 @@ export function transcribe(stage) {
|
|
|
110
110
|
const block = tools.get(call.id);
|
|
111
111
|
if (block === undefined || block.kind !== "tool")
|
|
112
112
|
return;
|
|
113
|
-
|
|
113
|
+
// Explicit refusal stays a refusal. Cancellation can first settle an
|
|
114
|
+
// approval overlay as `no`, though, so its synthesized result must be
|
|
115
|
+
// allowed to reconcile that rail with the interrupted history.
|
|
116
|
+
if (block.tone === "deny" && summary !== "interrupted") {
|
|
114
117
|
stage.render(block);
|
|
115
118
|
return;
|
|
116
119
|
}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The package version is runtime identity, not configuration.
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
let cached;
|
|
5
|
+
export function applicationVersion() {
|
|
6
|
+
if (cached !== undefined)
|
|
7
|
+
return cached;
|
|
8
|
+
const manifest = JSON.parse(readFileSync(path.resolve(import.meta.dirname, "..", "package.json"), "utf8"));
|
|
9
|
+
if (typeof manifest.version !== "string" || manifest.version === "") {
|
|
10
|
+
throw new Error("package version is missing");
|
|
11
|
+
}
|
|
12
|
+
cached = manifest.version;
|
|
13
|
+
return cached;
|
|
14
|
+
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giovannijecha/jecode",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "An owned coding agent with zero external runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,12 +16,16 @@
|
|
|
16
16
|
"terminal",
|
|
17
17
|
"tui",
|
|
18
18
|
"ollama",
|
|
19
|
+
"openai",
|
|
20
|
+
"chatgpt",
|
|
21
|
+
"oauth",
|
|
19
22
|
"typescript"
|
|
20
23
|
],
|
|
21
24
|
"type": "module",
|
|
22
25
|
"files": [
|
|
23
26
|
"bin/",
|
|
24
27
|
"dist/",
|
|
28
|
+
"docs/assets/brand/jeco-256.png",
|
|
25
29
|
"LICENSE",
|
|
26
30
|
"README.md"
|
|
27
31
|
],
|