lockthard-cli 0.1.1__tar.gz → 0.1.3__tar.gz
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.
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/PKG-INFO +1 -1
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli/__init__.py +1 -1
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli/client.py +8 -2
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli/formatters.py +11 -3
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli.egg-info/PKG-INFO +1 -1
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/pyproject.toml +1 -1
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/README.md +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli/auth.py +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli/cli.py +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli/config.py +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli.egg-info/SOURCES.txt +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli.egg-info/dependency_links.txt +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli.egg-info/entry_points.txt +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli.egg-info/requires.txt +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/lockthard_cli.egg-info/top_level.txt +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/setup.cfg +0 -0
- {lockthard_cli-0.1.1 → lockthard_cli-0.1.3}/tests/test_cli.py +0 -0
|
@@ -114,7 +114,9 @@ class LockthardClient:
|
|
|
114
114
|
"name": "get_tablet",
|
|
115
115
|
"arguments": args
|
|
116
116
|
})
|
|
117
|
-
|
|
117
|
+
if isinstance(res, dict):
|
|
118
|
+
return res.get("tablet") or res
|
|
119
|
+
return {"tools": res if isinstance(res, list) else []}
|
|
118
120
|
|
|
119
121
|
def search_tools(self, query: str, tablet_id: Optional[str] = None, limit: int = 20) -> List[Dict[str, Any]]:
|
|
120
122
|
"""Search across all tools in LOCKTHARD directory."""
|
|
@@ -125,6 +127,8 @@ class LockthardClient:
|
|
|
125
127
|
"name": "search_tools",
|
|
126
128
|
"arguments": args
|
|
127
129
|
})
|
|
130
|
+
if isinstance(res, dict):
|
|
131
|
+
return res.get("results") or res.get("tools") or []
|
|
128
132
|
return res if isinstance(res, list) else []
|
|
129
133
|
|
|
130
134
|
def get_tool_details(self, tool_id: str) -> Dict[str, Any]:
|
|
@@ -133,7 +137,9 @@ class LockthardClient:
|
|
|
133
137
|
"name": "get_tool_details",
|
|
134
138
|
"arguments": {"tool_id": tool_id}
|
|
135
139
|
})
|
|
136
|
-
|
|
140
|
+
if isinstance(res, dict):
|
|
141
|
+
return res.get("tool") or res
|
|
142
|
+
return {}
|
|
137
143
|
|
|
138
144
|
def get_cli_tools(self) -> List[Dict[str, Any]]:
|
|
139
145
|
"""Fetch all CLI specific tools from LOCKTHARD."""
|
|
@@ -65,16 +65,18 @@ def print_tablets_list(tablets: List[Dict[str, Any]], as_json: bool = False):
|
|
|
65
65
|
table.add_column("Herramientas", justify="right", style="green")
|
|
66
66
|
|
|
67
67
|
for t in tablets:
|
|
68
|
+
count = t.get("toolCount") or t.get("tool_count") or t.get("count") or len(t.get("tools") or t.get("items") or [])
|
|
68
69
|
table.add_row(
|
|
69
70
|
str(t.get("id") or t.get("slug") or "-"),
|
|
70
71
|
str(t.get("title") or t.get("name") or "-"),
|
|
71
72
|
str(t.get("category") or "General"),
|
|
72
|
-
str(
|
|
73
|
+
str(count)
|
|
73
74
|
)
|
|
74
75
|
console.print(table)
|
|
75
76
|
else:
|
|
76
77
|
for t in tablets:
|
|
77
|
-
|
|
78
|
+
count = t.get("toolCount") or t.get("tool_count") or t.get("count") or len(t.get("tools") or t.get("items") or [])
|
|
79
|
+
print(f"[{t.get('id')}] {t.get('title')} ({count} herramientas)")
|
|
78
80
|
|
|
79
81
|
|
|
80
82
|
def print_search_results(query: str, results: List[Dict[str, Any]], as_json: bool = False):
|
|
@@ -111,12 +113,15 @@ def print_search_results(query: str, results: List[Dict[str, Any]], as_json: boo
|
|
|
111
113
|
|
|
112
114
|
|
|
113
115
|
def print_tablet_content(tablet_data: Dict[str, Any], as_json: bool = False):
|
|
116
|
+
if isinstance(tablet_data, dict) and "tablet" in tablet_data and isinstance(tablet_data["tablet"], dict):
|
|
117
|
+
tablet_data = tablet_data["tablet"]
|
|
118
|
+
|
|
114
119
|
if as_json:
|
|
115
120
|
print(json.dumps(tablet_data, indent=2, ensure_ascii=False))
|
|
116
121
|
return
|
|
117
122
|
|
|
118
123
|
title = tablet_data.get("title") or tablet_data.get("name") or "Tablet"
|
|
119
|
-
items = tablet_data.get("items") or []
|
|
124
|
+
items = tablet_data.get("tools") or tablet_data.get("items") or []
|
|
120
125
|
|
|
121
126
|
if HAS_RICH and console:
|
|
122
127
|
console.print(Panel(f"[bold white]{title}[/bold white]\n[dim]{tablet_data.get('description', '')}[/dim]", border_style="cyan"))
|
|
@@ -141,6 +146,9 @@ def print_tablet_content(tablet_data: Dict[str, Any], as_json: bool = False):
|
|
|
141
146
|
|
|
142
147
|
|
|
143
148
|
def print_tool_details(tool: Dict[str, Any], as_json: bool = False):
|
|
149
|
+
if isinstance(tool, dict) and "tool" in tool and isinstance(tool["tool"], dict):
|
|
150
|
+
tool = tool["tool"]
|
|
151
|
+
|
|
144
152
|
if as_json:
|
|
145
153
|
print(json.dumps(tool, indent=2, ensure_ascii=False))
|
|
146
154
|
return
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|