Fix publish state tracking and add sync status feature

- Track moderation status (pending/approved/rejected) in local tool config
- Add new "pending" state indicator (◐ yellow) distinct from "published" (✓ green)
- Add "Sync Status" button to check registry for updated moderation status
- Add /me/tools/<name>/status API endpoint for checking tool status
- Improve admin panel error handling with better error messages

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
rob
2026-01-16 07:52:42 -04:00
co-authored by Claude Opus 4.5
parent 3fccf854be
commit f1c462146b
5 changed files with 151 additions and 11 deletions
+32
View File
@@ -1900,6 +1900,38 @@ def create_app() -> Flask:
})
return jsonify({"data": data})
@app.route("/api/v1/me/tools/<name>/status", methods=["GET"])
@require_token
def my_tool_status(name: str) -> Response:
"""Get the moderation status of a specific tool owned by the current user."""
owner = g.current_publisher["slug"]
# Query for the most recent version of this tool
row = query_one(
g.db,
"""
SELECT name, version, moderation_status, config_hash, published_at
FROM tools
WHERE owner = ? AND name = ?
ORDER BY published_at DESC
LIMIT 1
""",
[owner, name],
)
if not row:
return error_response("TOOL_NOT_FOUND", f"Tool '{name}' not found", 404)
return jsonify({
"data": {
"name": row["name"],
"version": row["version"],
"status": row["moderation_status"],
"config_hash": row["config_hash"],
"published_at": row["published_at"],
}
})
@app.route("/api/v1/tools/<owner>/<name>/deprecate", methods=["POST"])
@require_token
def deprecate_tool(owner: str, name: str) -> Response: