Add IPFS link to recipe S-expression display
- Show ipfs://... link next to recipe S-expression header - Links to ipfs.io gateway for viewing the raw S-expression Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -179,6 +179,7 @@ async def get_run(
|
|||||||
# Try to load the recipe to show the plan
|
# Try to load the recipe to show the plan
|
||||||
plan = None
|
plan = None
|
||||||
plan_sexp = None # Native S-expression if available
|
plan_sexp = None # Native S-expression if available
|
||||||
|
recipe_ipfs_cid = None
|
||||||
recipe_id = run.get("recipe")
|
recipe_id = run.get("recipe")
|
||||||
if recipe_id and len(recipe_id) == 64: # Looks like a hash
|
if recipe_id and len(recipe_id) == 64: # Looks like a hash
|
||||||
try:
|
try:
|
||||||
@@ -189,6 +190,8 @@ async def get_run(
|
|||||||
# Use native S-expression if available (code is data!)
|
# Use native S-expression if available (code is data!)
|
||||||
if recipe.get("sexp"):
|
if recipe.get("sexp"):
|
||||||
plan_sexp = recipe["sexp"]
|
plan_sexp = recipe["sexp"]
|
||||||
|
# Get IPFS CID for the recipe
|
||||||
|
recipe_ipfs_cid = recipe.get("ipfs_cid")
|
||||||
|
|
||||||
# Build steps for DAG visualization
|
# Build steps for DAG visualization
|
||||||
dag = recipe.get("dag", {})
|
dag = recipe.get("dag", {})
|
||||||
@@ -329,6 +332,7 @@ async def get_run(
|
|||||||
dag_elements=dag_elements,
|
dag_elements=dag_elements,
|
||||||
output_media_type=output_media_type,
|
output_media_type=output_media_type,
|
||||||
plan_sexp=plan_sexp,
|
plan_sexp=plan_sexp,
|
||||||
|
recipe_ipfs_cid=recipe_ipfs_cid,
|
||||||
active_tab="runs",
|
active_tab="runs",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -159,8 +159,16 @@
|
|||||||
<!-- Recipe/Plan S-expression -->
|
<!-- Recipe/Plan S-expression -->
|
||||||
{% if plan_sexp %}
|
{% if plan_sexp %}
|
||||||
<details class="mt-6" open>
|
<details class="mt-6" open>
|
||||||
<summary class="cursor-pointer text-gray-400 hover:text-white text-sm mb-2">
|
<summary class="cursor-pointer text-gray-400 hover:text-white text-sm mb-2 flex items-center justify-between">
|
||||||
Recipe (S-expression)
|
<span>Recipe (S-expression)</span>
|
||||||
|
{% if recipe_ipfs_cid %}
|
||||||
|
<a href="https://ipfs.io/ipfs/{{ recipe_ipfs_cid }}"
|
||||||
|
target="_blank"
|
||||||
|
onclick="event.stopPropagation()"
|
||||||
|
class="text-blue-400 hover:text-blue-300 text-xs font-mono ml-4">
|
||||||
|
ipfs://{{ recipe_ipfs_cid[:16] }}...
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</summary>
|
</summary>
|
||||||
<div class="bg-gray-900 rounded-lg border border-gray-700 p-4 overflow-x-auto">
|
<div class="bg-gray-900 rounded-lg border border-gray-700 p-4 overflow-x-auto">
|
||||||
<pre class="text-sm font-mono sexp-code">{{ plan_sexp }}</pre>
|
<pre class="text-sm font-mono sexp-code">{{ plan_sexp }}</pre>
|
||||||
|
|||||||
Reference in New Issue
Block a user