From b996389183c0795c9b24c17a4f8093b263e55aed Mon Sep 17 00:00:00 2001 From: "molecule-ai[bot]" <276602405+molecule-ai[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 19:00:46 +0000 Subject: [PATCH] fix(config): add models[] array for canvas model dropdown (#3) Co-authored-by: Molecule AI Plugin-Dev --- .molecule-ci/scripts/requirements.txt | 1 + .../scripts/validate-workspace-template.py | 47 +++++++++++++++++++ config.yaml | 18 +++++-- 3 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 .molecule-ci/scripts/requirements.txt create mode 100644 .molecule-ci/scripts/validate-workspace-template.py diff --git a/.molecule-ci/scripts/requirements.txt b/.molecule-ci/scripts/requirements.txt new file mode 100644 index 0000000..3aecde9 --- /dev/null +++ b/.molecule-ci/scripts/requirements.txt @@ -0,0 +1 @@ +pyyaml>=6.0 diff --git a/.molecule-ci/scripts/validate-workspace-template.py b/.molecule-ci/scripts/validate-workspace-template.py new file mode 100644 index 0000000..5d87063 --- /dev/null +++ b/.molecule-ci/scripts/validate-workspace-template.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +"""Validate a Molecule AI workspace template repo.""" +import os, sys, yaml + +errors = [] + +if not os.path.isfile("config.yaml"): + print("::error::config.yaml not found at repo root") + sys.exit(1) + +with open("config.yaml") as f: + config = yaml.safe_load(f) + +if not config.get("name"): + errors.append("Missing required field: name") +if not config.get("runtime"): + errors.append("Missing required field: runtime") + +known = {"langgraph", "claude-code", "crewai", "autogen", "deepagents", "hermes", "gemini-cli", "openclaw"} +runtime = config.get("runtime", "") +if runtime and runtime not in known: + print(f"::warning::Runtime '{runtime}' is not in the known set. OK for custom runtimes.") + +# Check for legacy imports +if os.path.isfile("adapter.py"): + with open("adapter.py") as f: + content = f.read() + if "molecule_runtime" in content: + print("::warning::adapter.py imports 'molecule_runtime' — legacy import, use 'molecule_ai' or platform SDK") + +# Check for missing molecule-ai-workspace-runtime dependency hint +if os.path.isfile("Dockerfile"): + with open("Dockerfile") as f: + content = f.read() + if "molecule-ai-workspace-runtime" not in content: + print("::warning::Dockerfile does not reference 'molecule-ai-workspace-runtime' — may need base runtime package") + +sv = config.get("template_schema_version") +if sv is None: + errors.append("Missing template_schema_version (add: template_schema_version: 1)") + +if errors: + for e in errors: + print(f"::error::{e}") + sys.exit(1) + +print(f"✓ config.yaml valid: {config['name']} (runtime: {config.get('runtime')})") diff --git a/config.yaml b/config.yaml index d38c60b..af7429e 100644 --- a/config.yaml +++ b/config.yaml @@ -2,12 +2,22 @@ name: CrewAI Agent description: CrewAI — role-based agent with task delegation and crew orchestration version: 1.0.0 tier: 2 - runtime: crewai model: openai:gpt-4.1-mini - env: required: - - OPENAI_API_KEY - + - OPENAI_API_KEY template_schema_version: 1 +models: +- id: openai:gpt-4.1-mini + name: GPT-4.1 Mini (OpenAI) + required_env: + - OPENAI_API_KEY +- id: openai:gpt-4o + name: GPT-4o (OpenAI) + required_env: + - OPENAI_API_KEY +- id: openai:o4-mini + name: o4-Mini (OpenAI) + required_env: + - OPENAI_API_KEY