@maintainer-pro/ai-server 0.1.5 → 0.1.7
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/package.json +2 -2
- package/src/server.mjs +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maintainer-pro/ai-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Node HTTP server for Maintainer Pro chat. Uses @maintainer-pro/ai-cli to talk to coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maintainer-pro",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@maintainer-pro/ai-cli": "^0.1.
|
|
33
|
+
"@maintainer-pro/ai-cli": "^0.1.7",
|
|
34
34
|
"@maintainer-pro/ai-ui": "^0.2.5",
|
|
35
35
|
"ws": "^8.21.3"
|
|
36
36
|
},
|
package/src/server.mjs
CHANGED
|
@@ -616,6 +616,10 @@ export async function startAiServer(options = {}) {
|
|
|
616
616
|
assistantMessageId,
|
|
617
617
|
senderType: event.message.senderType === "client" ? "client" : undefined,
|
|
618
618
|
senderName: event.message.senderName ?? undefined,
|
|
619
|
+
context:
|
|
620
|
+
event.message.context && typeof event.message.context === "object"
|
|
621
|
+
? event.message.context
|
|
622
|
+
: undefined,
|
|
619
623
|
});
|
|
620
624
|
publishChatResult(conversationId, result, assistantMessageId, userMessageId);
|
|
621
625
|
if (!result.ok) {
|
|
@@ -716,6 +720,7 @@ export async function startAiServer(options = {}) {
|
|
|
716
720
|
hasMessages: Array.isArray(msg.messages),
|
|
717
721
|
messageCount: Array.isArray(msg.messages) ? msg.messages.length : 0,
|
|
718
722
|
skipPersistUser: msg.skipPersistUser,
|
|
723
|
+
hasContext: Boolean(msg.context && typeof msg.context === "object"),
|
|
719
724
|
},
|
|
720
725
|
"ws chat.run"
|
|
721
726
|
);
|
|
@@ -736,6 +741,10 @@ export async function startAiServer(options = {}) {
|
|
|
736
741
|
typeof msg.senderType === "string" ? msg.senderType : "client",
|
|
737
742
|
senderName:
|
|
738
743
|
typeof msg.senderName === "string" ? msg.senderName : null,
|
|
744
|
+
context:
|
|
745
|
+
msg.context && typeof msg.context === "object"
|
|
746
|
+
? msg.context
|
|
747
|
+
: undefined,
|
|
739
748
|
},
|
|
740
749
|
});
|
|
741
750
|
logger.info(
|
|
@@ -799,6 +808,8 @@ export async function startAiServer(options = {}) {
|
|
|
799
808
|
assistantMessageId,
|
|
800
809
|
senderType: typeof msg.senderType === "string" ? msg.senderType : undefined,
|
|
801
810
|
senderName: typeof msg.senderName === "string" ? msg.senderName : undefined,
|
|
811
|
+
context:
|
|
812
|
+
msg.context && typeof msg.context === "object" ? msg.context : undefined,
|
|
802
813
|
});
|
|
803
814
|
publishChatResult(conversationId, result, assistantMessageId, userMessageId);
|
|
804
815
|
if (!result.ok) {
|