lockthard-cli 0.1.2__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockthard-cli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Super efficient CLI for LOCKTHARD AI tools directory and agents
5
5
  Author-email: Lockthard Team <info@lockthard.es>
6
6
  License: MIT
@@ -2,4 +2,4 @@
2
2
  LOCKTHARD CLI - Command Line Interface and Agent Client for LOCKTHARD.
3
3
  """
4
4
 
5
- __version__ = "0.1.2"
5
+ __version__ = "0.1.4"
@@ -114,7 +114,9 @@ class LockthardClient:
114
114
  "name": "get_tablet",
115
115
  "arguments": args
116
116
  })
117
- return res if isinstance(res, dict) else {"items": res}
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
- return res if isinstance(res, dict) else {}
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."""
@@ -113,6 +113,9 @@ def print_search_results(query: str, results: List[Dict[str, Any]], as_json: boo
113
113
 
114
114
 
115
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
+
116
119
  if as_json:
117
120
  print(json.dumps(tablet_data, indent=2, ensure_ascii=False))
118
121
  return
@@ -124,25 +127,42 @@ def print_tablet_content(tablet_data: Dict[str, Any], as_json: bool = False):
124
127
  console.print(Panel(f"[bold white]{title}[/bold white]\n[dim]{tablet_data.get('description', '')}[/dim]", border_style="cyan"))
125
128
 
126
129
  if items:
127
- table = Table(title=f"Herramientas en {title} ({len(items)})", show_header=True)
128
- table.add_column("Nombre", style="bold green")
129
- table.add_column("Descripción", style="white")
130
- table.add_column("Enlace", style="blue")
131
-
130
+ # Group items by section
131
+ sections: Dict[str, List[Dict[str, Any]]] = {}
132
132
  for item in items:
133
- desc = item.get("description") or item.get("desc") or ""
134
- url = item.get("url") or item.get("href") or item.get("repo") or "-"
135
- table.add_row(str(item.get("name") or "-"), desc, str(url))
136
- console.print(table)
133
+ sec_name = item.get("section") or "General"
134
+ sections.setdefault(sec_name, []).append(item)
135
+
136
+ for sec_title, sec_items in sections.items():
137
+ section_header = f"📁 {sec_title}" if sec_title != "General" else f"🛠️ Herramientas ({len(sec_items)})"
138
+ table = Table(title=section_header, show_header=True, header_style="bold yellow")
139
+ table.add_column("Nombre", style="bold green")
140
+ table.add_column("Descripción", style="white")
141
+ table.add_column("Enlace", style="blue")
142
+
143
+ for item in sec_items:
144
+ desc = item.get("description") or item.get("desc") or ""
145
+ url = item.get("url") or item.get("href") or item.get("repo") or "-"
146
+ table.add_row(str(item.get("name") or "-"), desc, str(url))
147
+ console.print(table)
137
148
  else:
138
149
  console.print("[yellow]No hay herramientas registradas en esta tablet.[/yellow]")
139
150
  else:
140
151
  print(f"=== {title} ===")
152
+ sections: Dict[str, List[Dict[str, Any]]] = {}
141
153
  for item in items:
142
- print(f"- {item.get('name')}: {item.get('url')}")
154
+ sec_name = item.get("section") or "General"
155
+ sections.setdefault(sec_name, []).append(item)
156
+ for sec_title, sec_items in sections.items():
157
+ print(f"\n--- {sec_title} ---")
158
+ for item in sec_items:
159
+ print(f"- {item.get('name')}: {item.get('url')}")
143
160
 
144
161
 
145
162
  def print_tool_details(tool: Dict[str, Any], as_json: bool = False):
163
+ if isinstance(tool, dict) and "tool" in tool and isinstance(tool["tool"], dict):
164
+ tool = tool["tool"]
165
+
146
166
  if as_json:
147
167
  print(json.dumps(tool, indent=2, ensure_ascii=False))
148
168
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockthard-cli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Super efficient CLI for LOCKTHARD AI tools directory and agents
5
5
  Author-email: Lockthard Team <info@lockthard.es>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lockthard-cli"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Super efficient CLI for LOCKTHARD AI tools directory and agents"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
File without changes
File without changes