Connector extension contract
IMPLEMENTED internal extension contract: context-connector.v1 in runtime/engine/connectors.mjs. A trusted integration module registers a unique type before loading a Project:
registerConnector('internal-feed', {
version: '1', capabilities: ['observe', 'revision'],
async observe(source, { now, limits }) {
// Use boundedFetch for safe HTTP/credential/deadline handling.
// Return observed items plus revision/currentness/provenance.
}
});
Lifecycle is register → normalize configuration → observe → immutable Build snapshot → runtime resolution. Only observe is mandatory. Capability names describe observation operations the implementation actually performs; HTTP reads during observe, MCP discovers and reads during observe. There is no pretend incremental-refresh/search method for a connector that cannot support one. Such optional methods can be added by a versioned extension, not silently assumed by callers.
Return items (ref, locator, digest, content, byte estimate and metadata), revision, revisionKind, currentness, and pinned/live dependency. Use the existing makeItem helper and content hashes. Keep remote secret values outside the return object and source configuration. Resolve only external secret references. Failure must throw a safe EngineError; the wrapper returns UNAVAILABLE, revision unknown and stats.complete=false.
Limits are part of the contract: bound bytes, item count, item size, requests, deadlines and metadata. Honor include/exclude locators. Test successful data, changed revisions, missing credentials, server failure, malformed content, limits, reflected secrets, pinning and runtime integration against a local fixture. A connector cannot decide participation or edit source data.
Extensions run as trusted code in the embedding process. Runtime core does not require changes to add a registered implementation, but desktop packaging must explicitly import trusted extension code. Dynamic plugin discovery, untrusted-code sandboxing and a marketplace are FUTURE. Do not install arbitrary modules from context data.