@network-harness/sdk
v0.2.0
Published
Contracts extensions of the network harness compile against.
Readme
@network-harness/sdk
What extensions compile against. Contracts only: the common types, the branded
ids and their schemas, the manifest, the seam contracts, and the Context and
Events declaration merges. No component behavior lives here, which is what
lets an extension depend on this package and nothing else in the repo.
One file per component, each carrying that component's own seam:
| file | contract |
| -------------- | ------------------------------------------------------------------------- |
| common.ts | branded ids and the one path-safety rule, Json, Timestamp, Disposer |
| errors.ts | HarnessError and the codes callers match on |
| identity.ts | Identity |
| network.ts | NetworkAdapter, Envelope, PeerRef, Transport |
| discovery.ts | Discovery, Advertisement, DiscoveryProvider |
| llm.ts | LlmLoop, RunSpec, LlmExecutor, ToolProvider |
| data.ts | DataManagement, Policy, UseProvider |
| artifacts.ts | ArtifactStore, the one protocol service type |
| trace.ts | Trace |
| api.ts | ControlApi |
| manifest.ts | ExtensionManifest, Needs, Schedule |
| protocols.ts | ProtocolsHost, ExtensionBinding |
| context.ts | the ctx.* service keys and the host/* events |
Three deliberate departures from docs/spec.md, the first two in the direction of its own conventions:
- The seam contracts are interfaces rather than abstract classes, so the sdk
emits no runtime code beyond
HarnessErrorand the schemas. trace.appendtakes a record without anactor: attribution comes from the accessing context, so a caller cannot supply it.triggerstays an input -- only the caller knows whether it acted for a human, a peer, or itself.DataManagementgainsdescribeSource(). The spec hasSourceInfo.describedAsand nothing that sets it; a data function is what knows what it wrote, so the description is the owner's to write.NetworkAdaptergainsroute()andlocalAddresses().routeis how the protocols host tells the adapter which protocols this node runs, which the spec requires ("an envelope naming a protocol this node does not run is rejected") without saying who writes it; the host is the only thing that knows a manifest. A discovery provider registers this node as aPeerRef, whose addresses belong to the transports and are therefore known only to the adapter; without this there is no way to build one.
