Add collapsible README viewer to tool details panel and owner override for publish
- Add collapsible README section to tools page detail panel with lazy loading - README loads from disk only when user clicks the toggle bar - Section collapses to a single header bar, expands to show content - Add --owner flag to registry publish command for admin use - Simplify dependency gathering in publish to use unified code path Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
@@ -456,21 +456,20 @@ def _cmd_registry_publish(args):
|
||||
my_owner = None
|
||||
|
||||
tool = load_tool(name)
|
||||
if tool:
|
||||
dep_result = gather_local_unpublished_deps([name], client, my_owner)
|
||||
else:
|
||||
# Tool isn't installed locally; derive deps from config.yaml
|
||||
temp_tool = Tool.from_dict(data)
|
||||
dep_names = []
|
||||
for dep in temp_tool.dependencies:
|
||||
if '/' not in dep:
|
||||
dep_names.append(dep)
|
||||
for step in temp_tool.steps:
|
||||
if isinstance(step, ToolStep) and '/' not in step.tool:
|
||||
dep_names.append(step.tool)
|
||||
dep_names = sorted(set(dep_names))
|
||||
if dep_names:
|
||||
dep_result = gather_local_unpublished_deps(dep_names, client, my_owner)
|
||||
if not tool:
|
||||
# Tool isn't installed locally; derive from config.yaml
|
||||
tool = Tool.from_dict(data)
|
||||
|
||||
dep_names = []
|
||||
for dep in tool.dependencies:
|
||||
if '/' not in dep:
|
||||
dep_names.append(dep)
|
||||
for step in tool.steps:
|
||||
if isinstance(step, ToolStep) and '/' not in step.tool:
|
||||
dep_names.append(step.tool)
|
||||
dep_names = sorted(set(dep_names) - {name})
|
||||
if dep_names:
|
||||
dep_result = gather_local_unpublished_deps(dep_names, client, my_owner)
|
||||
except Exception as e:
|
||||
print(f"Warning: Could not check dependencies: {e}", file=sys.stderr)
|
||||
dep_result = None
|
||||
@@ -560,7 +559,8 @@ def _cmd_registry_publish(args):
|
||||
|
||||
try:
|
||||
client = get_client()
|
||||
result = client.publish_tool(config_yaml, readme, defaults)
|
||||
owner = getattr(args, "owner", "")
|
||||
result = client.publish_tool(config_yaml, readme, defaults, owner=owner)
|
||||
|
||||
pr_url = result.get("pr_url", "")
|
||||
status = result.get("status", "")
|
||||
|
||||
Reference in New Issue
Block a user