@docyrus/docyrus 0.0.36 → 0.0.37
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/main.js +264 -303
- package/main.js.map +3 -3
- package/package.json +1 -1
- package/server-loader.js +13 -7
- package/server-loader.js.map +2 -2
package/package.json
CHANGED
package/server-loader.js
CHANGED
|
@@ -4858,6 +4858,12 @@ function getLastAssistantMessage(messages) {
|
|
|
4858
4858
|
const lastMessage = messages[messages.length - 1];
|
|
4859
4859
|
return lastMessage.role === "assistant" ? lastMessage : void 0;
|
|
4860
4860
|
}
|
|
4861
|
+
function getChatUnavailableReason(params) {
|
|
4862
|
+
if (params.session.model) {
|
|
4863
|
+
return null;
|
|
4864
|
+
}
|
|
4865
|
+
return "No model configured. Complete provider login or select a model first.";
|
|
4866
|
+
}
|
|
4861
4867
|
function extractLastUserText(messages) {
|
|
4862
4868
|
if (messages.length === 0) {
|
|
4863
4869
|
return void 0;
|
|
@@ -5227,6 +5233,10 @@ async function createAgentServer(params) {
|
|
|
5227
5233
|
return c.json({ error: `Failed to resume session: ${msg}` }, 400);
|
|
5228
5234
|
}
|
|
5229
5235
|
}
|
|
5236
|
+
const chatUnavailableReason = getChatUnavailableReason({ session: activeSession });
|
|
5237
|
+
if (chatUnavailableReason) {
|
|
5238
|
+
return c.json({ error: chatUnavailableReason }, 409);
|
|
5239
|
+
}
|
|
5230
5240
|
const sessionId = body.sessionId?.trim() || activeSession.id?.trim() || "active";
|
|
5231
5241
|
const askUserResponse = extractAskUserToolResponse(messages);
|
|
5232
5242
|
const docyrusWebBrowserResponse = extractDocyrusWebBrowserToolResponse(messages);
|
|
@@ -6827,13 +6837,9 @@ async function main() {
|
|
|
6827
6837
|
});
|
|
6828
6838
|
spinner.stop();
|
|
6829
6839
|
if (!session.model) {
|
|
6830
|
-
|
|
6831
|
-
`No
|
|
6832
|
-
|
|
6833
|
-
Set an API key environment variable:
|
|
6834
|
-
ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, etc.
|
|
6835
|
-
|
|
6836
|
-
Or create ${modelsJsonPath}`
|
|
6840
|
+
process.stderr.write(
|
|
6841
|
+
` ${import_picocolors2.default.yellow("No model configured yet.")} Server will start so the client can complete provider login.
|
|
6842
|
+
`
|
|
6837
6843
|
);
|
|
6838
6844
|
}
|
|
6839
6845
|
await createAgentServer({
|