@devness/useai 0.4.6 → 0.4.8
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/index.js +11 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112,7 +112,7 @@ var VERSION;
|
|
|
112
112
|
var init_version = __esm({
|
|
113
113
|
"../shared/dist/constants/version.js"() {
|
|
114
114
|
"use strict";
|
|
115
|
-
VERSION = "0.4.
|
|
115
|
+
VERSION = "0.4.8";
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
|
|
@@ -1016,7 +1016,6 @@ var init_session_state = __esm({
|
|
|
1016
1016
|
this.heartbeatCount = 0;
|
|
1017
1017
|
this.sessionRecordCount = 0;
|
|
1018
1018
|
this.chainTipHash = GENESIS_HASH;
|
|
1019
|
-
this.clientName = "unknown";
|
|
1020
1019
|
this.sessionTaskType = "coding";
|
|
1021
1020
|
}
|
|
1022
1021
|
setClient(name) {
|
|
@@ -1082,6 +1081,15 @@ function getSessions() {
|
|
|
1082
1081
|
function getMilestones() {
|
|
1083
1082
|
return readJson(MILESTONES_FILE, []);
|
|
1084
1083
|
}
|
|
1084
|
+
function resolveClient(server2, session2) {
|
|
1085
|
+
if (session2.clientName !== "unknown") return;
|
|
1086
|
+
const clientInfo = server2.server.getClientVersion();
|
|
1087
|
+
if (clientInfo?.name) {
|
|
1088
|
+
session2.setClient(normalizeMcpClientName(clientInfo.name));
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
session2.setClient(detectClient());
|
|
1092
|
+
}
|
|
1085
1093
|
function registerTools(server2, session2) {
|
|
1086
1094
|
server2.tool(
|
|
1087
1095
|
"useai_session_start",
|
|
@@ -1091,7 +1099,7 @@ function registerTools(server2, session2) {
|
|
|
1091
1099
|
},
|
|
1092
1100
|
async ({ task_type }) => {
|
|
1093
1101
|
session2.reset();
|
|
1094
|
-
session2
|
|
1102
|
+
resolveClient(server2, session2);
|
|
1095
1103
|
session2.setTaskType(task_type ?? "coding");
|
|
1096
1104
|
const record = session2.appendToChain("session_start", {
|
|
1097
1105
|
client: session2.clientName,
|
|
@@ -3338,10 +3346,6 @@ async function startDaemon(port) {
|
|
|
3338
3346
|
const transport = new StreamableHTTPServerTransport({
|
|
3339
3347
|
sessionIdGenerator: () => randomUUID4(),
|
|
3340
3348
|
onsessioninitialized: (newSid) => {
|
|
3341
|
-
const clientInfo = mcpServer.server.getClientVersion();
|
|
3342
|
-
if (clientInfo?.name) {
|
|
3343
|
-
sessionState.setClient(normalizeMcpClientName(clientInfo.name));
|
|
3344
|
-
}
|
|
3345
3349
|
const idleTimer = setTimeout(async () => {
|
|
3346
3350
|
await cleanupSession(newSid);
|
|
3347
3351
|
}, IDLE_TIMEOUT_MS);
|