@hasna/coders 0.0.8 → 0.0.9
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.mjs +10 -8
- package/dist/cli.mjs.map +3 -3
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -58429,7 +58429,7 @@ var init_client = __esm({
|
|
|
58429
58429
|
"Content-Type": "application/json",
|
|
58430
58430
|
"anthropic-version": "2023-06-01",
|
|
58431
58431
|
"anthropic-beta": BETA_HEADERS.join(","),
|
|
58432
|
-
"User-Agent": `coders/${"0.0.
|
|
58432
|
+
"User-Agent": `coders/${"0.0.9"}`
|
|
58433
58433
|
};
|
|
58434
58434
|
if (key.isOAuth) {
|
|
58435
58435
|
headers["Authorization"] = `Bearer ${key.apiKey}`;
|
|
@@ -69932,6 +69932,8 @@ function App2({ model, mode, initialPrompt }) {
|
|
|
69932
69932
|
const [tokens, setTokens] = (0, import_react22.useState)(0);
|
|
69933
69933
|
const [history, setHistory] = (0, import_react22.useState)([]);
|
|
69934
69934
|
const [activeTools, setActiveTools] = (0, import_react22.useState)([]);
|
|
69935
|
+
const activeToolsRef = import_react22.default.useRef([]);
|
|
69936
|
+
activeToolsRef.current = activeTools;
|
|
69935
69937
|
const rows = stdout?.rows ?? 24;
|
|
69936
69938
|
const [permissionPending, setPermissionPending] = (0, import_react22.useState)(null);
|
|
69937
69939
|
const requestPermission = (0, import_react22.useCallback)((toolName, summary) => {
|
|
@@ -70024,9 +70026,10 @@ function App2({ model, mode, initialPrompt }) {
|
|
|
70024
70026
|
);
|
|
70025
70027
|
setCost((p) => p + c.totalCostUsd);
|
|
70026
70028
|
setTokens((p) => p + result.usage.totalInputTokens + result.usage.totalOutputTokens);
|
|
70027
|
-
const frozenTools = [...
|
|
70029
|
+
const frozenTools = [...activeToolsRef.current].map(
|
|
70028
70030
|
(t) => t.status === "running" ? { ...t, status: "done" } : t
|
|
70029
70031
|
);
|
|
70032
|
+
const verb = VERBS[Math.floor(Math.random() * VERBS.length)];
|
|
70030
70033
|
setMsgs((p) => [...p, {
|
|
70031
70034
|
id: `a${Date.now()}`,
|
|
70032
70035
|
role: "assistant",
|
|
@@ -70034,8 +70037,7 @@ function App2({ model, mode, initialPrompt }) {
|
|
|
70034
70037
|
timestamp: Date.now(),
|
|
70035
70038
|
tools: frozenTools.length > 0 ? frozenTools : void 0,
|
|
70036
70039
|
durationMs: dur,
|
|
70037
|
-
durationVerb:
|
|
70038
|
-
// Fixed once at creation
|
|
70040
|
+
durationVerb: verb
|
|
70039
70041
|
}]);
|
|
70040
70042
|
setHistory(result.messages.filter((m) => m.role === "user" || m.role === "assistant"));
|
|
70041
70043
|
setStreaming("");
|
|
@@ -70072,8 +70074,8 @@ function App2({ model, mode, initialPrompt }) {
|
|
|
70072
70074
|
} else if (key.escape) setInput("");
|
|
70073
70075
|
else if (!key.ctrl && !key.meta && ch) setInput((p) => p + ch);
|
|
70074
70076
|
});
|
|
70075
|
-
const
|
|
70076
|
-
const visible = msgs.slice(-
|
|
70077
|
+
const maxVisibleMsgs = busy ? 2 : Math.max(3, Math.floor((rows - 6) / 4));
|
|
70078
|
+
const visible = msgs.slice(-maxVisibleMsgs);
|
|
70077
70079
|
const recentTools = activeTools.slice(-3);
|
|
70078
70080
|
const streamLines = streaming.split("\n");
|
|
70079
70081
|
const maxStreamLines = Math.max(3, rows - 15);
|
|
@@ -70402,8 +70404,8 @@ async function bootstrap() {
|
|
|
70402
70404
|
var VERSION, BUILD_TIME, PACKAGE_NAME2, ISSUES_URL2, startupTimestamps, originalCwd, RESET_TERMINAL, cleanupHandlers, earlyInput, earlyInputCapturing;
|
|
70403
70405
|
var init_index = __esm({
|
|
70404
70406
|
"src/cli/index.ts"() {
|
|
70405
|
-
VERSION = "0.0.
|
|
70406
|
-
BUILD_TIME = "2026-03-20T08:
|
|
70407
|
+
VERSION = "0.0.9";
|
|
70408
|
+
BUILD_TIME = "2026-03-20T08:10:27.716Z";
|
|
70407
70409
|
PACKAGE_NAME2 = "@hasna/coders";
|
|
70408
70410
|
ISSUES_URL2 = "https://github.com/hasnaxyz/open-coders/issues";
|
|
70409
70411
|
startupTimestamps = {};
|