@devness/useai 0.4.7 → 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.
Files changed (2) hide show
  1. package/dist/index.js +11 -8
  2. 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.7";
115
+ VERSION = "0.4.8";
116
116
  }
117
117
  });
118
118
 
@@ -1081,6 +1081,15 @@ function getSessions() {
1081
1081
  function getMilestones() {
1082
1082
  return readJson(MILESTONES_FILE, []);
1083
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
+ }
1084
1093
  function registerTools(server2, session2) {
1085
1094
  server2.tool(
1086
1095
  "useai_session_start",
@@ -1090,9 +1099,7 @@ function registerTools(server2, session2) {
1090
1099
  },
1091
1100
  async ({ task_type }) => {
1092
1101
  session2.reset();
1093
- if (session2.clientName === "unknown") {
1094
- session2.setClient(detectClient());
1095
- }
1102
+ resolveClient(server2, session2);
1096
1103
  session2.setTaskType(task_type ?? "coding");
1097
1104
  const record = session2.appendToChain("session_start", {
1098
1105
  client: session2.clientName,
@@ -3339,10 +3346,6 @@ async function startDaemon(port) {
3339
3346
  const transport = new StreamableHTTPServerTransport({
3340
3347
  sessionIdGenerator: () => randomUUID4(),
3341
3348
  onsessioninitialized: (newSid) => {
3342
- const clientInfo = mcpServer.server.getClientVersion();
3343
- if (clientInfo?.name) {
3344
- sessionState.setClient(normalizeMcpClientName(clientInfo.name));
3345
- }
3346
3349
  const idleTimer = setTimeout(async () => {
3347
3350
  await cleanupSession(newSid);
3348
3351
  }, IDLE_TIMEOUT_MS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devness/useai",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Track your AI-assisted development workflow. MCP server that records usage metrics across all your AI tools.",
5
5
  "keywords": [
6
6
  "mcp",