diff --git a/internal/httpapi/server.go b/internal/httpapi/server.go index 0faf7c6..9f75116 100644 --- a/internal/httpapi/server.go +++ b/internal/httpapi/server.go @@ -159,6 +159,7 @@ func NewHandler(ctx context.Context, pool *db.Pool, cfg config.Config) http.Hand // /api/v1/executions/{id}/logs — streamed command output, no schema type // /api/v1/learning/timeline — derived view, no backing schema type // /api/v1/learning/trend — derived view, no backing schema type + // /api/v1/openapi.json — API spec (embedded in binary), self-service // // See .agents/dev/CONTRIBUTING.md §OpenAPI codegen for the policy. @@ -296,6 +297,17 @@ func NewHandler(ctx context.Context, pool *db.Pool, cfg config.Config) http.Hand r.With(combinedAuth(cfg, false)).Get("/api/v1/learning/timeline", s.serveLearningTimeline) r.With(combinedAuth(cfg, false)).Get("/api/v1/learning/trend", s.serveLearningTrend) + // Serve the OpenAPI spec at a browseable endpoint (agents + humans) + r.Get("/api/v1/openapi.json", func(w http.ResponseWriter, req *http.Request) { + swagger, err := gen.GetSwagger() + if err != nil { + writeProblem(w, req, http.StatusInternalServerError, "failed to load spec", "") + return + } + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(swagger) + }) + // Mount MCP at /mcp (plan R3-10) nomosAgentID := uuid.Nil if cfg.NomosAgentID != "" { diff --git a/vendor/package.json b/vendor/package.json deleted file mode 100644 index 523267a..0000000 --- a/vendor/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@joan/procedural-glyph-engine", - "version": "0.1.0", - "private": true, - "type": "module", - "main": "./src/index.js", - "module": "./src/index.js", - "types": "./types/index.d.ts", - "exports": { - ".": { - "import": "./src/index.js", - "types": "./types/index.d.ts" - } - } -} \ No newline at end of file diff --git a/vendor/src/index.js b/vendor/src/index.js deleted file mode 100644 index 6476075..0000000 --- a/vendor/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -export function createGlyph(_seed, resolution) { - const size = resolution - const half = size / 2 - return ` - - - - - - - - ` -} \ No newline at end of file