Skip to main content

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, and StepContext
  • WorkflowIntegration plus typed config-model discovery for Python integrations
  • JSON-RPC request/response models for setup, execute, and teardown
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charter_integration_sdk-0.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charter_integration_sdk-0.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

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

Hashes for charter_integration_sdk-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7919cce4f1c70df40d6b164996ab51707a9a9190dbbc7e2d720e56fc9d16ec5d
MD5 f43a8e46bae85696ca47a1b0f226ca47
BLAKE2b-256 3b72dd7a5f252bfab9400e5b60767889c0f9824d62d0eb75230742c16872cf7a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file charter_integration_sdk-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for charter_integration_sdk-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b8426da34daec1ccabe5b87ba38b8e3bdf10a0909fb3be9c649affa0562fbaa
MD5 b954a8882437b945f01ad402f670b911
BLAKE2b-256 bfb8de639f6a49ba441b87d985c784299d28a9b380ff5048360108a547f5ea2c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page