Skip to content

feat(studio): L07 export an agent as YAML or as a bundle - #1071

Merged
LinuxDevil merged 2 commits into
mainfrom
fb-l07
Nov 12, 2026
Merged

LinuxDevil merged 2 commits into
mainfrom
fb-l07

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • GET /agents/:id/export?format=yaml downloads the working-copy spec as text/yaml (<id>.yaml); format=bundle downloads a lousho.agent-bundle JSON (<id>.lousho-agent.json) with spec, labels, the prompt-registry text spec.promptRef names, and the eval datasets it gates on.
  • Bundle pieces are fetched from the observe daemon (observeTarget() + daemonHeaders(), 8s deadline): daemon down/404 degrades to an X-Lousho-Export-Warnings header (URI-encoded JSON string[]) instead of failing the download. Secret values never appear - the spec only holds { env }/{ secret } references.
  • New AgentBundle wire type; exportYaml/buildBundle/registerExportRoutes in server/lifecycle/export.ts (workspace seam: repo via workspaceOf(req)).
  • runtimeClient.downloadExport reads Content-Disposition filename + warnings header; the header overflow menu's Export YAML now goes through the route and gains Export bundle (FileDown/Package icons); warnings toast one per line, failures toast Export failed: <message>.
  • Removed the now-dead client-side downloadYaml helper.

Test plan

  • npm run test:server --workspace apps/agent-forge - export.test.ts: 7 tests (yaml round-trip headers/content, bundle with prompt+labels+evals, daemon-down warning header, failing dataset warning, no promptRef/evals, 400/404, secret value absent) - all pass
  • npx vitest run --root apps/agent-forge AgentActionsMenu exportMenu importExport - 15 tests pass (menu items call downloadExport with right format, warning/error toasts, filename downloads)
  • npm run typecheck + npm run typecheck:server --workspace apps/agent-forge - clean
  • npx eslint on changed files - clean
  • npx fallow audit --base origin/main - no issues in 10 changed files
  • Acceptance: YAML round-trips through loadSpec; bundle has kind/version/spec/labels/exportedAt; daemon-down bundle still downloads with warning; { secret: 'GITHUB_TOKEN' } value ghp_example absent from both exports

Generated with Devin

LinuxDevil and others added 2 commits November 12, 2026 01:52
GET /agents/:id/export?format=yaml serves the working-copy spec as a
text/yaml attachment; format=bundle serves a lousho.agent-bundle JSON
with the spec, labels, the prompt-registry text spec.promptRef names
and the eval datasets it gates on - each pulled from the observe daemon
with an 8s deadline, degrading to a X-Lousho-Export-Warnings header
rather than failing when the daemon cannot serve a piece. Secret values
never appear: the spec only ever holds { env }/{ secret } references.

The header overflow menu's Export YAML now downloads through the route
(client-side serializeSpec is gone for it) and gains Export bundle;
warnings surface as warning toasts, failures as error toasts.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
# Conflicts:
#	apps/agent-forge/server/app.ts
@LinuxDevil
LinuxDevil merged commit c48cb87 into main Nov 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant