SharpClaw .NET modules run as a compiled module DLL plus a package.json
manifest. For normal module execution, SharpClaw launches the module outside the
parent process through SharpClaw.SidecarHost.OutOfProcess. That package
provides the host executable and payload used to load the module assembly,
validate the manifest, expose lifecycle and tool endpoints, and proxy host
capabilities back to SharpClaw over the foreign-module protocol.
SharpClaw.SidecarHost.InProcess is for the limited opt-in path where a host
loads a module DLL directly inside its own process. It provides
RegistrationLoadContext, a collectible assembly load context that resolves the
module's private dependencies while keeping SharpClaw contract assemblies shared
with the host. Use it only when the host deliberately supports in-process module
loading and can accept the tighter coupling that comes with it.
For module developers, the practical shape is the same in either case: build a
.NET assembly that implements the SharpClaw module contracts, place it in the
module directory, and describe it with package.json. Unless a host explicitly
opts into in-process loading, expect the module to be run by the out-of-process
host.
Modules can declare typed endpoint and CLI contributions through
IApplicationRegistrationSource. The out-of-process host carries those declarations
through sidecar discovery and invokes CLI handlers through the same module graph.
Use DefineAction when a module owns both an action contract and its terminal.
The SDK supplies deterministic schema identities when the descriptor does not
contain them. The descriptor still controls capabilities, safe points, repeat
policy, continuation policy, timeout, and sensitive-data classification.
module.DefineAction(PermissionActions.Check).UseTerminal<PermissionCheckTerminal>(PermissionTerminals.Check);Use module.Actions.Add and module.AddActionEntry when the module must control
the two registrations separately. Both APIs use the same compiler validation and
produce the same contribution graph.