JSON-RPC integration contract for Charter — the only dependency provider integrations need.
Project description
charter-integration-sdk
Protocol and integration contract package for Charter. Install this when you are building an integration and want the shared message models and WorkflowIntegration interface without pulling in the runtime or CLI.
pip install charter-integration-sdk
Use This Package When
- You are authoring a Charter integration in Python.
- You need the JSON-RPC message models used by subprocess integrations.
- You want to validate integration inputs and outputs against the same contract the runtime uses.
For workflow authoring, project config, and end-to-end run examples, see the main Charter README.
What charter-integration-sdk Provides
WorkflowIntegration,ResolvedStep, andStepContextWorkflowIntegrationplus typed config-model discovery for Python integrations- JSON-RPC request/response models for
setup,execute, andteardown - shared output-type definitions used by integrations and the runtime
What It Does Not Do
- It does not run workflows; that belongs to
charter-core. - It does not manage projects, install requirements, or resolve capabilities; that belongs to
charter-cli.
Python Provider Skeleton
from pydantic import BaseModel
from typing import Any
from charter_integration_sdk import ResolvedStep, StepContext, WorkflowIntegration
class MyConfig(BaseModel):
api_token: str
class MyIntegration(WorkflowIntegration):
config: MyConfig
async def execute(self, step: ResolvedStep, context: StepContext) -> Any:
instruction = step.with_config["prompt"]
inputs = context.inputs
result = do_work(instruction, inputs, api_token=self.config.api_token)
return result
step contains the runner-normalized step definition. The integration receives the merged config at execute time; it is responsible for deciding which fields apply at setup vs invocation. context.inputs is the resolved input map your integration should actually use at execution time.
context.outputs and context.named_outputs are convenience views over prior step outputs, but artifact-backed values are only guaranteed to be hydrated when the current step declares them in inputs:. For undeclared artifact dependencies, those views may still contain artifact refs rather than full payloads.
Subprocess Protocol
Subprocess-backed integrations speak newline-delimited JSON-RPC 2.0 over stdin / stdout:
→ {"jsonrpc":"2.0","id":"1","method":"setup","params":{"run_id":"abc123"}}
← {"jsonrpc":"2.0","id":"1","result":{"ok":true}}
→ {"jsonrpc":"2.0","id":"2","method":"execute","params":{"step":{...},"context":{...}}}
← {"jsonrpc":"2.0","id":"2","result":{"value":"some value"}}
→ {"jsonrpc":"2.0","id":"3","method":"teardown","params":{}}
← {"jsonrpc":"2.0","id":"3","result":{"ok":true}}
The matching models are available from charter_integration_sdk.messages:
from charter_integration_sdk.messages import (
ExecuteParams,
ExecuteResult,
JsonRpcRequest,
JsonRpcResponse,
SetupParams,
SetupResult,
TeardownParams,
TeardownResult,
)
Entry Point Registration
If you package a Python integration for uses: resolution, register it under the charter.integrations entry-point group:
[project.entry-points."charter.integrations"]
my_llm = "my_package.integrations:MyIntegration"
stripe_api = "my_package.integrations:StripeIntegration"
Charter discovers uses: integrations from installed package metadata at
runtime, so the integration package must be installed in the active environment.
Public API Highlights
from charter_integration_sdk import (
ExecuteParams,
ExecuteResult,
JsonRpcRequest,
JsonRpcResponse,
ResolvedStep,
SetupParams,
SetupResult,
StepContext,
TeardownParams,
TeardownResult,
WorkflowIntegration,
integration_config_model,
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file charter_integration_sdk-0.0.1.tar.gz.
File metadata
- Download URL: charter_integration_sdk-0.0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7919cce4f1c70df40d6b164996ab51707a9a9190dbbc7e2d720e56fc9d16ec5d
|
|
| MD5 |
f43a8e46bae85696ca47a1b0f226ca47
|
|
| BLAKE2b-256 |
3b72dd7a5f252bfab9400e5b60767889c0f9824d62d0eb75230742c16872cf7a
|
Provenance
The following attestation bundles were made for charter_integration_sdk-0.0.1.tar.gz:
Publisher:
release-charter-integration-sdk.yml on charter-tool/charter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
charter_integration_sdk-0.0.1.tar.gz -
Subject digest:
7919cce4f1c70df40d6b164996ab51707a9a9190dbbc7e2d720e56fc9d16ec5d - Sigstore transparency entry: 1568428335
- Sigstore integration time:
-
Permalink:
charter-tool/charter@d58661e0e372f9b13b777bc0dcdab6cc176d3321 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/charter-tool
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-charter-integration-sdk.yml@d58661e0e372f9b13b777bc0dcdab6cc176d3321 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file charter_integration_sdk-0.0.1-py3-none-any.whl.
File metadata
- Download URL: charter_integration_sdk-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b8426da34daec1ccabe5b87ba38b8e3bdf10a0909fb3be9c649affa0562fbaa
|
|
| MD5 |
b954a8882437b945f01ad402f670b911
|
|
| BLAKE2b-256 |
bfb8de639f6a49ba441b87d985c784299d28a9b380ff5048360108a547f5ea2c
|
Provenance
The following attestation bundles were made for charter_integration_sdk-0.0.1-py3-none-any.whl:
Publisher:
release-charter-integration-sdk.yml on charter-tool/charter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
charter_integration_sdk-0.0.1-py3-none-any.whl -
Subject digest:
5b8426da34daec1ccabe5b87ba38b8e3bdf10a0909fb3be9c649affa0562fbaa - Sigstore transparency entry: 1568428382
- Sigstore integration time:
-
Permalink:
charter-tool/charter@d58661e0e372f9b13b777bc0dcdab6cc176d3321 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/charter-tool
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-charter-integration-sdk.yml@d58661e0e372f9b13b777bc0dcdab6cc176d3321 -
Trigger Event:
workflow_dispatch
-
Statement type: