@usine/gateway/node
Classes
Section titled “Classes”ConflictingAnthropicCredentials
Section titled “ConflictingAnthropicCredentials”The gateway set an Anthropic API key and a subscription token at once; only one can be sent.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConflictingAnthropicCredentials(…
args):ConflictingAnthropicCredentials
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”ConflictingAnthropicCredentials
Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
EgressProxyListenError
Section titled “EgressProxyListenError”The forward proxy could not listen on its address.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new EgressProxyListenError(…
args):EgressProxyListenError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlyhost:string
message
Section titled “message”
readonlymessage:string
readonlyport:number
GatewayAddresses
Section titled “GatewayAddresses”The addresses the gateway’s three servers are bound to, with any port 0 replaced by the port the system chose.
Extends
Section titled “Extends”Context.ServiceClass
Properties
Section titled “Properties”Service
Section titled “Service”
readonlyService:object
The service’s operations: what yield* GatewayAddresses returns.
readonlyadmin:Listener
egress
Section titled “egress”
readonlyegress:Listener
readonlyproxy:Listener
Interfaces
Section titled “Interfaces”GatewayListeners
Section titled “GatewayListeners”The three listeners: the reverse proxy Workers reach for GitHub and the LLMs, the forward proxy for allowlisted hosts, and the admin API for the executor.
Properties
Section titled “Properties”
readonlyadmin:Listener
egress
Section titled “egress”
readonlyegress:Listener
readonlyproxy:Listener
Listener
Section titled “Listener”An address and port a gateway server listens on.
Properties
Section titled “Properties”
readonlyhost:string
readonlyport:number
Variables
Section titled “Variables”DEFAULT_EGRESS_ALLOWLIST_PATH
Section titled “DEFAULT_EGRESS_ALLOWLIST_PATH”
constDEFAULT_EGRESS_ALLOWLIST_PATH:"/etc/usine-gateway/egress-allowlist"="/etc/usine-gateway/egress-allowlist"
Where the gateway reads its egress allowlist when USINE_GATEWAY_EGRESS_ALLOWLIST is not set.
gatewayFromEnvironment
Section titled “gatewayFromEnvironment”
constgatewayFromEnvironment:Layer.Layer<Attachments|CallerTokens|GatewayAddresses,ConfigError|ConflictingAnthropicCredentials|EgressAllowlistError|EgressProxyListenError|PlatformError|ServeError,FileSystem>
The gateway configured from the environment and its allowlist file, as the usine-gateway command runs it.
gatewayLayer
Section titled “gatewayLayer”
constgatewayLayer: (listeners) =>Layer.Layer<Attachments|CallerTokens|GatewayAddresses,EgressProxyListenError|ServeError,GatewaySettings>
The gateway on Node: the reverse proxy, the forward proxy, and the admin
API on their listeners, sharing one attachment store and caller token
signer. Upstream requests use undici, which leaves content-encoding
alone, so compressed bodies pass through byte for byte.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
listeners |
GatewayListeners |
Returns
Section titled “Returns”Layer.Layer<Attachments | CallerTokens | GatewayAddresses, EgressProxyListenError | ServeError, GatewaySettings>
listenersFromEnvironment
Section titled “listenersFromEnvironment”
constlistenersFromEnvironment:Config.Config<{admin: {host:string;port:number; };egress: {host:string;port:number; };proxy: {host:string;port:number; }; }>
Listeners from the environment. The proxies default to loopback so that a gateway started without configuration is reachable from nowhere; the VM’s unit sets them to its private address.
settingsFromEnvironment
Section titled “settingsFromEnvironment”
constsettingsFromEnvironment:Layer.Layer<GatewaySettings,Config.ConfigError|ConflictingAnthropicCredentials|EgressAllowlistError|PlatformError,FileSystem.FileSystem>
Reads the gateway’s settings once at startup: the domain and secrets from the environment, and the egress allowlist from its file. A missing secret, an invalid value, or an unreadable allowlist stops the gateway before it listens.