 d7ad321176
			
		
	
	d7ad321176
	
	
	
		
			
			This comprehensive implementation includes: - FastAPI backend with MCP server integration - React/TypeScript frontend with Vite - PostgreSQL database with Redis caching - Grafana/Prometheus monitoring stack - Docker Compose orchestration - Full MCP protocol support for Claude Code integration Features: - Agent discovery and management across network - Visual workflow editor and execution engine - Real-time task coordination and monitoring - Multi-model support with specialized agents - Distributed development task allocation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
		
			
				
	
	
		
			63 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { ignoreOverride } from "./Options.js";
 | |
| import { selectParser } from "./selectParser.js";
 | |
| import { getRelativePath } from "./getRelativePath.js";
 | |
| import { parseAnyDef } from "./parsers/any.js";
 | |
| export function parseDef(def, refs, forceResolution = false) {
 | |
|     const seenItem = refs.seen.get(def);
 | |
|     if (refs.override) {
 | |
|         const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
 | |
|         if (overrideResult !== ignoreOverride) {
 | |
|             return overrideResult;
 | |
|         }
 | |
|     }
 | |
|     if (seenItem && !forceResolution) {
 | |
|         const seenSchema = get$ref(seenItem, refs);
 | |
|         if (seenSchema !== undefined) {
 | |
|             return seenSchema;
 | |
|         }
 | |
|     }
 | |
|     const newItem = { def, path: refs.currentPath, jsonSchema: undefined };
 | |
|     refs.seen.set(def, newItem);
 | |
|     const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);
 | |
|     // If the return was a function, then the inner definition needs to be extracted before a call to parseDef (recursive)
 | |
|     const jsonSchema = typeof jsonSchemaOrGetter === "function"
 | |
|         ? parseDef(jsonSchemaOrGetter(), refs)
 | |
|         : jsonSchemaOrGetter;
 | |
|     if (jsonSchema) {
 | |
|         addMeta(def, refs, jsonSchema);
 | |
|     }
 | |
|     if (refs.postProcess) {
 | |
|         const postProcessResult = refs.postProcess(jsonSchema, def, refs);
 | |
|         newItem.jsonSchema = jsonSchema;
 | |
|         return postProcessResult;
 | |
|     }
 | |
|     newItem.jsonSchema = jsonSchema;
 | |
|     return jsonSchema;
 | |
| }
 | |
| const get$ref = (item, refs) => {
 | |
|     switch (refs.$refStrategy) {
 | |
|         case "root":
 | |
|             return { $ref: item.path.join("/") };
 | |
|         case "relative":
 | |
|             return { $ref: getRelativePath(refs.currentPath, item.path) };
 | |
|         case "none":
 | |
|         case "seen": {
 | |
|             if (item.path.length < refs.currentPath.length &&
 | |
|                 item.path.every((value, index) => refs.currentPath[index] === value)) {
 | |
|                 console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
 | |
|                 return parseAnyDef(refs);
 | |
|             }
 | |
|             return refs.$refStrategy === "seen" ? parseAnyDef(refs) : undefined;
 | |
|         }
 | |
|     }
 | |
| };
 | |
| const addMeta = (def, refs, jsonSchema) => {
 | |
|     if (def.description) {
 | |
|         jsonSchema.description = def.description;
 | |
|         if (refs.markdownDescription) {
 | |
|             jsonSchema.markdownDescription = def.description;
 | |
|         }
 | |
|     }
 | |
|     return jsonSchema;
 | |
| };
 |