codegen: move bridge specifics into the catalog
Bridge specifics (service, base-URL config var, auth header/token var, config-var docs, endpoints with error shapes) now live in BridgeInfo and render through describe_bridges(), which is injected into body, retry, regen, elicitation, and testgen prompts. SKILL.md/TESTGEN.md carry only the generic pattern. - regen prompt regains the catalog (was a dangling reference) - elicitation integration hint rides body/retry/regen as an advisory - top-level simplex_bridge_token config var; bootstrap syncs it - simplex seeds read the token and send X-Semif-Token when set
This commit is contained in:
1 parent
d0df6f16c4
commit
98ec4ee5e2
19 files changed
+324
-89
No files matched your search
@@ -22,7 +22,7 @@ from semif_agent.skills import ActionResult, Prediction
|
||||
INTEGRATION = {
|
||||
"service": "simplex",
|
||||
"transport": "http",
|
||||
"config_vars": ["simplex_bridge_url"],
|
||||
"config_vars": ["simplex_bridge_url", "simplex_bridge_token"],
|
||||
}
|
||||
|
||||
TIMEOUT_SECONDS = 30
|
||||
@@ -39,8 +39,15 @@ def _base(ctx):
|
||||
return url
|
||||
|
||||
|
||||
def _headers(ctx):
|
||||
token = str(ctx.config.get("simplex_bridge_token", "") or "").strip()
|
||||
return {"X-Semif-Token": token} if token else {}
|
||||
|
||||
|
||||
def _get(ctx, path):
|
||||
request = urllib.request.Request(_base(ctx) + path)
|
||||
request = urllib.request.Request(
|
||||
_base(ctx) + path, headers=_headers(ctx)
|
||||
)
|
||||
try:
|
||||
with urllib.request.urlopen(request, timeout=TIMEOUT_SECONDS) as response:
|
||||
return json.loads(response.read().decode("utf-8"))
|
||||
|
||||
Reference in new issue
Block a user