mcpspan 0.5.0 → 0.6.0
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.
- checksums.yaml +4 -4
- data/lib/mcpspan/collector.rb +4 -1
- data/lib/mcpspan/text.rb +2 -19
- data/lib/mcpspan/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 184dd27a9089025a9a5a1e7bad3558248a4d252d1d8b2cb84553b575f35fe2c3
|
|
4
|
+
data.tar.gz: 7d4c2bf7e4f43096ff05268dcd3ef815b92a495cbed763126aee28f3ad05b161
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a83a5bd3eacaaa255feb8d8502f9a6fb37b4d35bab3146d7c05ec9954357cdae718df0adb74898118469421fca78e8bea966e9cad4f9fbb68d5e62f738a88ea6
|
|
7
|
+
data.tar.gz: 7649be55373354f59a4df45029b863435c4744fdfc4439b42021293546c7f3c24e5a805add9d97d8cce18d0a44f9aea0789a14101bab5a7e881104ab2719ef6e
|
data/lib/mcpspan/collector.rb
CHANGED
|
@@ -139,7 +139,10 @@ module McpSpan
|
|
|
139
139
|
error_source: source,
|
|
140
140
|
error_type: type && Text.truncate(type, Text::MAX_NAME),
|
|
141
141
|
error_message: message.nil? || message.empty? ? nil : message,
|
|
142
|
-
|
|
142
|
+
# Always "unknown": the mcpspan server decides the client from its name
|
|
143
|
+
# (contract, 7). Sent only because servers released before 2026-10-15
|
|
144
|
+
# refuse an event without it.
|
|
145
|
+
client_type: "unknown",
|
|
143
146
|
client_name: Text.client_name(call.client_name),
|
|
144
147
|
client_version: Text.version(call.client_version),
|
|
145
148
|
server_version: Text.version(call.server_version),
|
data/lib/mcpspan/text.rb
CHANGED
|
@@ -11,15 +11,6 @@ module McpSpan
|
|
|
11
11
|
# A release, a tag, a commit: the server's or the client's.
|
|
12
12
|
MAX_VERSION = 100
|
|
13
13
|
|
|
14
|
-
# First match wins, so `claude-code` is tested before `claude`.
|
|
15
|
-
CLIENT_TYPES = [
|
|
16
|
-
[["claude-code", "claude code"], "claude-code"],
|
|
17
|
-
[["claude"], "claude"],
|
|
18
|
-
[["cursor"], "cursor"],
|
|
19
|
-
[%w[chatgpt openai], "chatgpt"],
|
|
20
|
-
[["inspector"], "mcp-inspector"],
|
|
21
|
-
].freeze
|
|
22
|
-
|
|
23
14
|
module_function
|
|
24
15
|
|
|
25
16
|
# Cuts text to a limit in characters, leaving a visible sign that something was removed.
|
|
@@ -28,16 +19,8 @@ module McpSpan
|
|
|
28
19
|
text.length <= limit ? text : "#{text[0, limit - 3]}..."
|
|
29
20
|
end
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
lower = name.downcase
|
|
35
|
-
CLIENT_TYPES.each do |needles, type|
|
|
36
|
-
return type if needles.any? { |needle| lower.include?(needle) }
|
|
37
|
-
end
|
|
38
|
-
"other"
|
|
39
|
-
end
|
|
40
|
-
|
|
22
|
+
# The name as the client gave it, cut to what the API takes. The mcpspan
|
|
23
|
+
# server tells clients apart by it (contract, 7).
|
|
41
24
|
def client_name(name)
|
|
42
25
|
return nil if name.nil? || name.strip.empty?
|
|
43
26
|
|
data/lib/mcpspan/version.rb
CHANGED