Add mk_mcp_from_refs(['module:function', ...]) + public import_object#2
Merged
Conversation
One call from configuration strings to a runnable MCP server — what tools that read tool references from a file (e.g. coact's mcp realize backend) need, so they don't reimplement the importlib dance. - util.import_object(ref): resolve 'module:attr' (preferred) or 'module.path.attr' - main.mk_mcp_from_refs(refs, ...): resolve each ref and delegate to mk_mcp_server Additive; existing API unchanged. Tests + doctests green. Closes #1
thorwhalen
added a commit
to thorwhalen/coact
that referenced
this pull request
Jun 4, 2026
- llm.py: provider-agnostic facade. resolve_llm() accepts a callable, an aw StepConfig (reuses its resolve_llm), a model name, or None->ambient skill.ai.chat; returns None (never raises) when nothing is available. structured(prompt, schema) does instruct-JSON + parse + one retry. - synthesis.py: synthesize_persona gains an optional llm that DRAFTS the identity paragraph; invariants + the return contract stay deterministic so the machine-facing contract is never at the mercy of generation. Drafting fires ONLY when an llm is explicitly injected — the mechanical path stays offline even when an ambient API key is present (DECISIONS D10). - complete(): optional llm= threaded through (non-breaking); LLM failure falls back to template. - realize.py: 'mcp' backend reads the source skill's coact: mcp block and delegates to py2mcp.mk_mcp_from_refs (coact writes no MCP plumbing). Companion py2mcp PR i2mint/py2mcp#2 added mk_mcp_from_refs + import_object. 55 tests + 28 doctests + ruff green; mechanical path verified offline. Refs #9 #10 #13
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One call from configuration strings to a runnable MCP server — what tools that read tool references from a file (e.g. coact's
mcprealize backend) need, so they don't reimplement theimportlibdance.util.import_object(ref)— resolve'module:attr'(preferred) or'module.path.attr'.main.mk_mcp_from_refs(refs, *, name=..., input_trans=...)— resolve each ref viaimport_objectand delegate tomk_mcp_server.Additive; existing API unchanged. New unit tests + doctests green (20 passed).
Closes #1.