[AVAILABLE], every code block below was run in this session against
@parmana/connector-sdk, commit 651497a.Goal
Implement aConnector, verify it hermetically without a real target system, and
understand precisely what’s required to reach the running default server, which today is a
bootstrap code change, not configuration.
Prerequisites
- Read The gateway and Credential isolation first, this guide assumes you know where a Connector sits in the pipeline and that it never resolves its own credential.
Steps
1. Implement the Connector interface
A Connector validates a request, executes using an already-resolved credential, and returns a deterministic response. It never evaluates policy, authorizes execution, or resolves a credential itself, credential resolution happens exclusively inside the gateway boundary, before a Connector is ever called.ConnectorCapability is a namespaced verb (crm:read, payments:refund, http:post),
validated eagerly by connectorCapabilities(), a malformed one throws at construction, not
at execution time. By convention ExecutableContent.action is the capability string, note
ConnectorRequest carries both a capability field and a separate action field, they’re
expected to match.
2. Test it hermetically with MockConnector
MockConnector scripts a response without a real target system:
mock.invocations records every ConnectorRequest the connector received, so a test can
assert exactly what was executed. To test failure handling, use
script: { failWith: new Error("upstream unavailable") } instead of respond.
Verify
Both calls above returned{ success: true, metadata: { recordId: "example-1" } } and
mock.invocations.length === 1, confirmed in this session. Version and health checks fail
closed before your connector is ever invoked: SdkConnectorExecutor rejects execution if a
configured expectedVersion doesn’t match the connector’s own metadata.version, or if
metadata.health.status === "unavailable".
What reaching the default server actually requires
Troubleshoot
does not declare capability "..."thrown byMockConnectoror your own connector.request.capabilitydidn’t match anything inconnectorCapabilities([...]). Check for a typo, capability strings are exact, case-sensitive matches.SdkConnectorExecutorrejects with a version mismatch. AnexpectedVersionwas configured at registration and your connector’smetadata.versiondoesn’t match, this guards a rolling deployment that swapped connector builds underneath a pinned expectation.- Registered your connector but
POST /executestill says “No connector registered for action.” Registration in aConnectorSdkRegistryyou constructed yourself doesn’t reach the running default server, that server builds its own registry increateConnectorRegistry.ts, see the Warning above.
Next
Issue and verify session credentials
What your connector’s
context.credential actually is, and its lifecycle.Credential isolation
The concept this guide’s credential handling exercises.