golf-mcp 0.1.8__py3-none-any.whl → 0.1.9__py3-none-any.whl

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.

Potentially problematic release.


This version of golf-mcp might be problematic. Click here for more details.

golf/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.8"
1
+ __version__ = "0.1.9"
golf/core/builder.py CHANGED
@@ -1116,9 +1116,13 @@ def build_import_map(project_path: Path, common_files: Dict[str, Path]) -> Dict[
1116
1116
  try:
1117
1117
  rel_to_component = dir_path.relative_to(component_type)
1118
1118
  # Create the new import path
1119
- new_path = f"components.{component_type}.{rel_to_component}".replace("/", ".")
1120
- # Fix any double dots
1121
- new_path = new_path.replace("..", ".")
1119
+ if str(rel_to_component) == ".":
1120
+ # This is at the root of the component type
1121
+ new_path = f"components.{component_type}"
1122
+ else:
1123
+ # Replace path separators with dots
1124
+ path_parts = str(rel_to_component).replace("\\", "/").split("/")
1125
+ new_path = f"components.{component_type}.{'.'.join(path_parts)}"
1122
1126
 
1123
1127
  # Map both the directory and the common file
1124
1128
  orig_module = dir_path_str
golf/core/telemetry.py CHANGED
@@ -7,7 +7,6 @@ from pathlib import Path
7
7
  from typing import Optional, Dict, Any
8
8
  import json
9
9
  import uuid
10
- import getpass
11
10
 
12
11
  import posthog
13
12
  from rich.console import Console
@@ -26,6 +25,7 @@ POSTHOG_HOST = "https://us.i.posthog.com"
26
25
  # Telemetry state
27
26
  _telemetry_enabled: Optional[bool] = None
28
27
  _anonymous_id: Optional[str] = None
28
+ _user_identified: bool = False # Track if we've already identified the user
29
29
 
30
30
 
31
31
  def get_telemetry_config_path() -> Path:
@@ -142,16 +142,10 @@ def get_anonymous_id() -> str:
142
142
  pass
143
143
 
144
144
  # Generate new ID with more unique data
145
- # Include home directory path to differentiate between users on same machine
146
- # Include a random component to ensure uniqueness even with identical setups
145
+ # Use only non-identifying system information
147
146
 
148
- try:
149
- username = getpass.getuser()
150
- except Exception:
151
- username = "unknown"
152
-
153
- # Combine multiple factors for uniqueness
154
- machine_data = f"{platform.node()}-{platform.machine()}-{platform.system()}-{username}-{str(Path.home())}"
147
+ # Combine non-identifying factors for uniqueness
148
+ machine_data = f"{platform.machine()}-{platform.system()}-{platform.python_version()}"
155
149
  machine_hash = hashlib.sha256(machine_data.encode()).hexdigest()[:8]
156
150
 
157
151
  # Add a random component to ensure uniqueness
@@ -200,6 +194,8 @@ def track_event(event_name: str, properties: Optional[Dict[str, Any]] = None) ->
200
194
  event_name: Name of the event (e.g., "cli_init", "cli_build")
201
195
  properties: Optional properties to include with the event
202
196
  """
197
+ global _user_identified
198
+
203
199
  if not is_telemetry_enabled():
204
200
  return
205
201
 
@@ -215,33 +211,33 @@ def track_event(event_name: str, properties: Optional[Dict[str, Any]] = None) ->
215
211
  # Get anonymous ID
216
212
  anonymous_id = get_anonymous_id()
217
213
 
218
- # Set person properties to differentiate installations
219
- # This helps PostHog understand these are different users
220
- try:
221
- hostname = platform.node()
222
- except Exception:
223
- hostname = "unknown"
224
-
225
- person_properties = {
226
- "$set": {
227
- "golf_version": __version__,
228
- "os": platform.system(),
229
- "hostname": hostname,
230
- "python_version": f"{platform.python_version_tuple()[0]}.{platform.python_version_tuple()[1]}",
214
+ # Only identify the user once per session
215
+ if not _user_identified:
216
+ # Set person properties to differentiate installations
217
+ # Only include non-identifying information
218
+ person_properties = {
219
+ "$set": {
220
+ "golf_version": __version__,
221
+ "os": platform.system(),
222
+ "python_version": f"{platform.python_version_tuple()[0]}.{platform.python_version_tuple()[1]}",
223
+ }
231
224
  }
232
- }
233
-
234
- # Identify the user with properties
235
- posthog.identify(
236
- distinct_id=anonymous_id,
237
- properties=person_properties
238
- )
225
+
226
+ # Identify the user with properties
227
+ posthog.identify(
228
+ distinct_id=anonymous_id,
229
+ properties=person_properties
230
+ )
231
+
232
+ _user_identified = True
239
233
 
240
234
  # Only include minimal, non-identifying properties
241
235
  safe_properties = {
242
236
  "golf_version": __version__,
243
237
  "python_version": f"{platform.python_version_tuple()[0]}.{platform.python_version_tuple()[1]}",
244
238
  "os": platform.system(),
239
+ # Explicitly disable IP tracking
240
+ "$ip": None,
245
241
  }
246
242
 
247
243
  # Filter properties to only include safe ones
@@ -2,4 +2,4 @@ GOLF_CLIENT_ID="default-client-id"
2
2
  GOLF_CLIENT_SECRET="default-secret"
3
3
  JWT_SECRET="example-jwt-secret-for-development-only"
4
4
  OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318/v1/traces"
5
- OTEL_SERVICE_NAME="golf-mcp"
5
+ OTEL_SERVICE_NAME="golf-mcp"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: golf-mcp
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Framework for building MCP servers
5
5
  Author-email: Antoni Gmitruk <antoni@golf.dev>
6
6
  License-Expression: Apache-2.0
@@ -1,4 +1,4 @@
1
- golf/__init__.py,sha256=1CUarGSwycOh0GKIcMutmmKE9j9E4B6-Jji1lJFY5Aw,21
1
+ golf/__init__.py,sha256=248SFgOW8tTzDpyY6euJ1BwIHMa4uimdKSyc2FGEEZE,21
2
2
  golf/auth/__init__.py,sha256=nh22WdganrEtp0YnxX1dmk6euuUFu8zh1BWxi1LGZnI,4107
3
3
  golf/auth/api_key.py,sha256=TWJJ1tyVPSp1vN61opn3DdGKfQkTLX2w-YyLO4eeRPk,2495
4
4
  golf/auth/helpers.py,sha256=eKUIhdsaxa9bBtU6BaVZszTtS1ZV1v1fzvCkXV__9pM,2965
@@ -11,16 +11,16 @@ golf/commands/build.py,sha256=yhcUrK9gHnXNuLPZ2brcmtMgR8wXMBlEBcaBgTKkanI,2295
11
11
  golf/commands/init.py,sha256=I-fe7PBDX0vfKCLGXMppD7Uo03LzRbx-bCM2Mt3UzdU,7155
12
12
  golf/commands/run.py,sha256=dLrjmpypfvInDkA-KgEUyKrTvkvp59yea5tUyxk_Ej4,1989
13
13
  golf/core/__init__.py,sha256=RDSMAkB5NDaV7W5OFJ--miqv6JmvM3rI9ashndqM3X4,52
14
- golf/core/builder.py,sha256=C7FUPiQ59EYx6807nRkZoFMyHCrIIqzrk39Da4fo_ew,48037
14
+ golf/core/builder.py,sha256=5N2OwEtpPnjtSYxFzV8f_hBR6BUddD5p7zrPwaHmZjU,48256
15
15
  golf/core/builder_auth.py,sha256=ySu_nzoUgGYEP-8DCoSFwgoEW6NMFiQ_MP0v6akOEUI,17217
16
16
  golf/core/builder_telemetry.py,sha256=v2LnlHRWg9JqgplfZkV3zm1Jpo8QQBr7hlY8NLhlu8o,2694
17
17
  golf/core/config.py,sha256=gZ3eE8VIvDgIrLTizNq9XqkgfMkRg8Pm06gSVV51arA,6806
18
18
  golf/core/parser.py,sha256=sCVMWO7sGkSaKkU9LiHC3O9CTcrZxUbxnjdtwP7ne_o,19251
19
- golf/core/telemetry.py,sha256=46eJ92zR3cY2DFQRWFMjIKTBHBRypEaSM-ddS1LUdus,9035
19
+ golf/core/telemetry.py,sha256=zUAYLbAV3sza603hlZfmWvsAzm1em0ttZsrS5tA5EBw,8988
20
20
  golf/core/transformer.py,sha256=3mr4_K4l1HZl1WQWSt9NKEhB5oi3b7kJnniseYEfrcI,5573
21
21
  golf/examples/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
22
22
  golf/examples/api_key/.env,sha256=15dewTdeJEMAIuzQmh1SFc1zEN6PwryWgAc14IV02lY,90
23
- golf/examples/api_key/.env.example,sha256=k_wpsqp0oRLLRw520NL3VrbJx4KDZclczYBW1YUgjvw,214
23
+ golf/examples/api_key/.env.example,sha256=zKXwnfCHdmycsESR8z5b8-rvYnaN3SagxrwL6B_VGjA,215
24
24
  golf/examples/api_key/README.md,sha256=nuc4YIspX_eokoArylBv6rKPv5P8BTq__2YaInidrUk,2892
25
25
  golf/examples/api_key/golf.json,sha256=_2ty1kOBZSyR2HMLU_-2CegFkE6U1jY-AiX4Bq664sQ,262
26
26
  golf/examples/api_key/pre_build.py,sha256=JfevA986fodhgDv9JEXtgB9mn7SQEXbBaSoGGR9XyYY,469
@@ -47,9 +47,9 @@ golf/examples/basic/tools/payments/common.py,sha256=z5shSOZizUEnxBmGUSYghxmNwIvu
47
47
  golf/examples/basic/tools/payments/refund.py,sha256=3auhKzuwPLgpoyUDz0p8lUWUY_fXNe0RYadQBxEvpB4,1603
48
48
  golf/telemetry/__init__.py,sha256=TFinunN7eFKEHMFUXjPBpz-JzuEu59QzrXwgg85YlQs,397
49
49
  golf/telemetry/instrumentation.py,sha256=520owHHBHlm819XD4FJ2dXrGbmGAjOMBXRREJJRgt7o,22890
50
- golf_mcp-0.1.8.dist-info/licenses/LICENSE,sha256=5_j2f6fTJmvfmUewzElhkpAaXg2grVoxKouOA8ihV6E,11348
51
- golf_mcp-0.1.8.dist-info/METADATA,sha256=5c7Pi2JDpq1vU9sIV4PSlFCZ9KIy1zw-D8CsCs2-Pdg,10909
52
- golf_mcp-0.1.8.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
53
- golf_mcp-0.1.8.dist-info/entry_points.txt,sha256=5y7rHYM8jGpU-nfwdknCm5XsApLulqsnA37MO6BUTYg,43
54
- golf_mcp-0.1.8.dist-info/top_level.txt,sha256=BQToHcBUufdyhp9ONGMIvPE40jMEtmI20lYaKb4hxOg,5
55
- golf_mcp-0.1.8.dist-info/RECORD,,
50
+ golf_mcp-0.1.9.dist-info/licenses/LICENSE,sha256=5_j2f6fTJmvfmUewzElhkpAaXg2grVoxKouOA8ihV6E,11348
51
+ golf_mcp-0.1.9.dist-info/METADATA,sha256=hjiUAnMdRZaAj6yuGpvGu08cFNHPlomW3-XRdfWlRUg,10909
52
+ golf_mcp-0.1.9.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
53
+ golf_mcp-0.1.9.dist-info/entry_points.txt,sha256=5y7rHYM8jGpU-nfwdknCm5XsApLulqsnA37MO6BUTYg,43
54
+ golf_mcp-0.1.9.dist-info/top_level.txt,sha256=BQToHcBUufdyhp9ONGMIvPE40jMEtmI20lYaKb4hxOg,5
55
+ golf_mcp-0.1.9.dist-info/RECORD,,