vole-agent 0.1.2 → 0.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/dist/app.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
CliChatSession,
|
|
4
4
|
loadConfig,
|
|
5
5
|
renderToolResult
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-O6SFTXIO.js";
|
|
7
7
|
|
|
8
8
|
// src/app.tsx
|
|
9
9
|
import { useState, useEffect, useCallback, useMemo, useRef as useRef2 } from "react";
|
|
@@ -452,6 +452,10 @@ function ChatApp({ config, cliOptions, sessionId }) {
|
|
|
452
452
|
async (message) => {
|
|
453
453
|
if (session === null || isSending || message.trim() === "") return;
|
|
454
454
|
const trimmed = message.trim();
|
|
455
|
+
if (config.secrets.apiKey === void 0) {
|
|
456
|
+
setMessages((prev) => [...prev, { role: "user", content: trimmed }, { role: "error", content: "No API key configured. Set VOLE_API_KEY or OPENROUTER_API_KEY in your .env file or environment." }]);
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
455
459
|
const controller = new AbortController();
|
|
456
460
|
abortControllerRef.current = controller;
|
|
457
461
|
setMessages((prev) => [...prev, { role: "user", content: trimmed }]);
|
|
@@ -672,13 +676,6 @@ async function runInkChat({ args, env, sessionsDirectory }) {
|
|
|
672
676
|
process.exitCode = 1;
|
|
673
677
|
return;
|
|
674
678
|
}
|
|
675
|
-
if (config.secrets.apiKey === void 0) {
|
|
676
|
-
process.stderr.write(
|
|
677
|
-
"Missing VOLE_API_KEY or OPENROUTER_API_KEY. Set one to start `vole chat`, or use `vole chat --fake-interactive` for local learning.\n"
|
|
678
|
-
);
|
|
679
|
-
process.exitCode = 1;
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
679
|
const sessionIndex = args.indexOf("--session");
|
|
683
680
|
const sessionId = sessionIndex !== -1 && args[sessionIndex + 1] !== void 0 ? args[sessionIndex + 1] : void 0;
|
|
684
681
|
const cliOptions = {
|
|
@@ -4123,9 +4123,6 @@ var CliChatSession = class _CliChatSession {
|
|
|
4123
4123
|
);
|
|
4124
4124
|
}
|
|
4125
4125
|
static async createConfigured(config, options = {}, sessionOptions = {}) {
|
|
4126
|
-
if (config.secrets.apiKey === void 0) {
|
|
4127
|
-
throw new Error("Configured chat requires an API key.");
|
|
4128
|
-
}
|
|
4129
4126
|
const sessionId = sessionOptions.sessionId ?? createSessionId();
|
|
4130
4127
|
const currentDate = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
4131
4128
|
const approvalPromptLog = [];
|
package/dist/index.js
CHANGED
package/dist/web/server.js
CHANGED
|
@@ -165,9 +165,6 @@ app.post("/api/sessions", async (c) => {
|
|
|
165
165
|
catch (err) {
|
|
166
166
|
return c.json({ error: err instanceof Error ? err.message : "Config error" }, 400);
|
|
167
167
|
}
|
|
168
|
-
if (config.secrets.apiKey === undefined) {
|
|
169
|
-
return c.json({ error: "Missing API key. Set VOLE_API_KEY or OPENROUTER_API_KEY." }, 400);
|
|
170
|
-
}
|
|
171
168
|
// Optional: resume an existing session by passing { sessionId }
|
|
172
169
|
const body = await c.req.json().catch(() => ({ sessionId: undefined }));
|
|
173
170
|
const existingSessionId = body.sessionId;
|
|
@@ -276,6 +273,9 @@ app.post("/api/sessions/:id/turns", async (c) => {
|
|
|
276
273
|
catch (err) {
|
|
277
274
|
return c.json({ error: err instanceof Error ? err.message : "Config error" }, 400);
|
|
278
275
|
}
|
|
276
|
+
if (config.secrets.apiKey === undefined) {
|
|
277
|
+
return c.json({ error: "No API key configured. Set VOLE_API_KEY or OPENROUTER_API_KEY in your environment or .env file." }, 400);
|
|
278
|
+
}
|
|
279
279
|
const store = getOrCreateSharedStore(config);
|
|
280
280
|
const recentRaw = await store.listMessages(id, { limit: 12 });
|
|
281
281
|
const recentMessages = recentRaw.map((m) => ({ role: m.role, content: m.content }));
|