coact.integration¶
IntegrationSpec — the target-neutral SSOT for a published integration.
coact’s COMPLETE/REALIZE axes turn skills into agent definitions and run them.
The PUBLISH axis (this module + coact.publish) is orthogonal: it takes
a capability — a set of Python tools given as 'module:function' refs, live
callables, or a skill’s coact: mcp: block — and ships it to a chatbot host as
a deployable integration (a Claude Desktop .mcpb bundle today; remote
connectors / skills / plugins / other hosts later).
The spec is deliberately separate from AgentDefinition
(which is agent-persona-centric): an integration is MCP-server-shaped
(tools/resources/prompts + auth + deployment), per the chatbot-integration
landscape research (misc/docs/CHATBOT_INTEGRATION_LANDSCAPE.md). The canonical
artifact is an MCP server, built by py2mcp — coact owns the spec, the
packaging, and the target registry, not the MCP plumbing (mirrors the mcp
realize backend, DECISIONS §6.1.3 / D17).
Module Attributes
a built spec, a |
Functions
|
Coerce a capability source into an |
Classes
|
Target-neutral description of an integration to publish. |
|
A richer, target-neutral description of one tool in an |
- coact.integration.IntegrationSource¶
a built spec, a
module:functionref, a skill source (path/Skill), a live callable, or an iterable of those.- Type:
What
integration_spec_from()accepts
alias of
IntegrationSpec|str|Path|Callable[[…],Any] |Iterable[Any]
- class coact.integration.IntegrationSpec(name, description='', version='0.1.0', tools=list(), resources=list(), prompts=list(), tool_specs=list(), instructions=None, auth='none', deployment='local-stdio', author=None, source=None)[source]¶
Bases:
objectTarget-neutral description of an integration to publish.
The connectivity core maps onto MCP’s three primitives. Tools come in two shapes that coexist: bare
'module:function'refs intools(the mechanical/code ingress) and richerToolSpecdescriptors intool_specs(the NL ingress, landscape-doc §9.1).resources/promptsand theauth/deploymenthints are declared now (open-closed) for the remote connector and other targets to come.>>> spec = IntegrationSpec(name='paths', tools=['os.path:basename']) >>> spec.name, spec.tools, spec.deployment ('paths', ['os.path:basename'], 'local-stdio') >>> IntegrationSpec(name='empty').is_empty() True >>> draft = IntegrationSpec(name='wx', tool_specs=[ToolSpec(name='get')]) >>> draft.is_empty(), draft.runnable_refs() (False, [])- is_empty()[source]¶
True when there is nothing to publish (no tools/tool_specs/resources/prompts).
- Return type:
- class coact.integration.ToolSpec(name, description='', input_schema=None, handler=None)[source]¶
Bases:
objectA richer, target-neutral description of one tool in an
IntegrationSpec.The mechanical ingress represents tools as bare
'module:function'ref strings (IntegrationSpec.tools). The NL ingress (coact.nl_ingress) and the landscape-doc §9.1 model need more — a name, a description, an input JSON Schema, and an optional handler ref:A ToolSpec with a
handleris bound (runnable): its ref joins the spec’s runnable set and the published server can import and call it.A ToolSpec without a handler is a proposed tool — a design draft to bind to real code (or supply a ref for) before it can run.
>>> ToolSpec(name='get_weather', handler='wx.api:current').is_bound() True >>> ToolSpec(name='get_weather').is_bound() False
- coact.integration.integration_spec_from(source, *, name=None, description='', version='0.1.0', author=None)[source]¶
Coerce a capability source into an
IntegrationSpec.Accepts (and flattens lists of): a prebuilt
IntegrationSpec, a'module:function'ref string, a live callable (its__module__:__qualname__becomes the ref), or a skill source carrying acoact: mcp:block. The resultingnameis kebab-cased so it is a safe, machine-readable bundle identifier.>>> integration_spec_from(['os.path:basename'], name='paths').tools ['os.path:basename'] >>> integration_spec_from('os.path:basename', name='My Tools').name 'my-tools'- Return type: