-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathregistry.py
More file actions
79 lines (72 loc) · 2.81 KB
/
registry.py
File metadata and controls
79 lines (72 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""
This file is auto-generated by scripts/generate_examples_md.py.
Do not edit manually.
"""
from __future__ import annotations
from typing import Any, Callable, cast
from .devbox_tunnel import run_devbox_tunnel_example
from .example_types import ExampleResult
from .devbox_snapshots import run_devbox_snapshots_example
from .mcp_github_tools import run_mcp_github_tools_example
from .secrets_with_devbox import run_secrets_with_devbox_example
from .devbox_snapshot_resume import run_devbox_snapshot_resume_example
from .blueprint_with_build_context import run_blueprint_with_build_context_example
from .devbox_from_blueprint_lifecycle import run_devbox_from_blueprint_lifecycle_example
ExampleRegistryEntry = dict[str, Any]
example_registry: list[ExampleRegistryEntry] = [
{
"slug": "blueprint-with-build-context",
"title": "Blueprint with Build Context",
"file_name": "blueprint_with_build_context.py",
"required_env": ["RUNLOOP_API_KEY"],
"run": run_blueprint_with_build_context_example,
},
{
"slug": "devbox-from-blueprint-lifecycle",
"title": "Devbox From Blueprint (Run Command, Shutdown)",
"file_name": "devbox_from_blueprint_lifecycle.py",
"required_env": ["RUNLOOP_API_KEY"],
"run": run_devbox_from_blueprint_lifecycle_example,
},
{
"slug": "devbox-snapshot-resume",
"title": "Devbox Snapshot and Resume",
"file_name": "devbox_snapshot_resume.py",
"required_env": ["RUNLOOP_API_KEY"],
"run": run_devbox_snapshot_resume_example,
},
{
"slug": "devbox-snapshots",
"title": "Devbox Snapshots (Suspend, Resume, Restore, Delete)",
"file_name": "devbox_snapshots.py",
"required_env": ["RUNLOOP_API_KEY"],
"run": run_devbox_snapshots_example,
},
{
"slug": "devbox-tunnel",
"title": "Devbox Tunnel (HTTP Server Access)",
"file_name": "devbox_tunnel.py",
"required_env": ["RUNLOOP_API_KEY"],
"run": run_devbox_tunnel_example,
},
{
"slug": "mcp-github-tools",
"title": "MCP Hub + Claude Code + GitHub",
"file_name": "mcp_github_tools.py",
"required_env": ["RUNLOOP_API_KEY", "GITHUB_TOKEN", "ANTHROPIC_API_KEY"],
"run": run_mcp_github_tools_example,
},
{
"slug": "secrets-with-devbox",
"title": "Secrets with Devbox and Agent Gateway",
"file_name": "secrets_with_devbox.py",
"required_env": ["RUNLOOP_API_KEY"],
"run": run_secrets_with_devbox_example,
},
]
def get_example_runner(slug: str) -> Callable[[], ExampleResult] | None:
"""Get the runner function for an example by slug."""
for entry in example_registry:
if entry["slug"] == slug:
return cast(Callable[[], ExampleResult], entry["run"])
return None