Model Tool Connection Message
OpenFrame Documentation
Get the most out of OpenFrame · Book 30 minutes with Conrad, 25 years in IT. He'll show you what Mingo and Fae can take off your list.
OpenFrame Documentation
Model Tool Connection Message is the compact, cross-language event payload used by the OpenFrame client to report that a locally installed tool is connected to a machine. It belongs to the Rust openframe_client library supplied by OpenFrame OSS Library and is run by this repository’s client deployment. The model establishes the wire-level link between a tool category and the platform-specific tool-agent identifier; the machine identity is carried by the NATS subject rather than by the payload.
The authoritative Rust definition is tool_connection_message.rs.
A tool connection must allow the backend to associate an OpenFrame machine with an integrated tool. Model Tool Connection Message contains exactly the two values needed for that association:
| Wire property | Rust field | Meaning |
|---|---|---|
toolType |
tool_type |
Non-empty category of the connected tool. The client-side processing manager skips tools that do not provide a type because the backend rejects an empty value. |
agentToolId |
agent_tool_id |
Identifier assigned to the tool agent that is connected to the machine. |
The Rust structure derives Serialize and Deserialize and applies Serde’s camelCase rename policy. Therefore, the Rust field names are implementation details; JSON producers and consumers exchange toolType and agentToolId.
{
"toolType": "example-tool-type",
"agentToolId": "example-agent-tool-id"
}
This model does not include the machine identifier, a timestamp, delivery status, credentials, endpoint information, or a result. Those responsibilities belong to the NATS routing envelope, connection-processing workflow, local connection state, and backend service respectively.
The model is part of the OpenFrame client’s tool-connection path. The Rust client discovers installed tools, resolves their command parameters, and uses the message publisher to serialize and publish the connection event. The Java client service consumes the event and records the machine-to-tool relationship.
flowchart LR
InstalledTools["Installed Tools Service"] --> ProcessingManager["Tool Connection Processing Manager"]
Parameters["Tool Command Parameters Resolver"] --> ProcessingManager
LocalConnections["Tool Connection Service"] --> ProcessingManager
ProcessingManager --> Publisher["Tool Connection Message Publisher"]
Publisher --> Message["Model Tool Connection Message"]
Message --> Nats["NATS subject: machine.*.tool-connection"]
Nats --> Listener["Tool Connection Listener"]
Listener --> BackendService["Backend Tool Connection Service"]
BackendService --> PlatformState["Machine Tool Connection State"]
publish operation accepts the machine ID separately from agentToolId and toolType, reinforcing that machine identity is encoded in routing rather than in the body.ToolConnection records. A record holds the tool-agent ID, agent-tool ID, and whether it has been published; records are keyed for replacement by tool-agent ID.machine.*.tool-connection, extracts the machine ID from the subject, deserializes the two JSON properties, and delegates association to its backend ToolConnectionService.flowchart TD
Model["Model Tool Connection Message"] --> Serde["Serde Serialize and Deserialize"]
Model --> Publisher["Tool Connection Message Publisher"]
Publisher --> NatsPublisher["NATS Message Publisher"]
Processing["Tool Connection Processing Manager"] --> Publisher
Processing --> ConnectionState["Tool Connection Service"]
Listener["Java Tool Connection Listener"] --> ModelContract["Camel Case JSON Contract"]
Listener --> SubjectIdentity["Machine ID From NATS Subject"]
Listener --> Backend["Backend Tool Connection Service"]
The model has a deliberately narrow dependency surface: it imports only Serde traits. It must remain compatible with the Java-side ToolConnectionMessage consumer from OpenFrame OSS Library because the listener maps the same camel-case properties before invoking backend connection handling.
The broader runtime assembly is supplied by the OpenFrame OSS Library at version 7.0.11 for Maven components and v0.0.5 for the openframe_agent_lib Cargo artifact. This repository deploys the OpenFrame client service alongside the NATS datasource used for message transport.
The normal connection-reporting process is asynchronous and subject-routed.
sequenceDiagram
participant Manager as Tool Connection Processing Manager
participant Publisher as Tool Connection Message Publisher
participant Nats as NATS
participant Listener as Tool Connection Listener
participant Service as Backend Tool Connection Service
Manager->>Manager: Load installed tools
Manager->>Manager: Skip tool with empty tool type
Manager->>Publisher: Publish machine ID, agent tool ID, tool type
Publisher->>Nats: Publish camel case JSON on machine-specific subject
Nats->>Listener: Deliver message on machine.*.tool-connection
Listener->>Listener: Extract machine ID and deserialize payload
Listener->>Service: Add tool connection
Service-->>Listener: Processing completes
Listener->>Nats: Acknowledge successful delivery
The Java listener uses the TOOL_CONNECTIONS stream and the tool-connection-processor-v2 consumer with the tool-connection delivery group. It reads NATS delivery metadata to determine whether the current delivery is the final attempt and passes that information to the backend service.
A message is acknowledged only after backend processing completes successfully. If subject extraction, JSON deserialization, or backend handling throws an exception, the listener leaves the message unacknowledged so NATS can redeliver it. The Rust publisher currently reports a publication error to its caller; its implementation notes that publisher acknowledgement and retry remain future work.
flowchart TD
Start["Client starts or tool is installed"] --> Load["Load installed tools"]
Load --> TypeCheck{"Tool type present?"}
TypeCheck -->|"No"| Skip["Skip connection publication"]
TypeCheck -->|"Yes"| LockCheck{"Processing already running?"}
LockCheck -->|"Yes"| Wake["Wake active loop or skip"]
LockCheck -->|"No"| Resolve["Resolve tool parameters"]
Resolve --> Build["Build Model Tool Connection Message"]
Build --> Publish["Publish through NATS"]
Publish --> Persist["Update local connection state"]
Persist --> Finish["Connection processing completes"]
On every client start, the processing manager re-resolves and republishes installed tool connections. This supports cases where an agent identifier changed outside the client, such as a tool re-key or backend data reset. A new installation uses the same workflow but requests immediate processing instead of waiting for a later periodic pass.
Changes to this model affect an asynchronous integration boundary. Maintain the following invariants:
toolType and agentToolId JSON names explicitly.ToolConnection state, which tracks publication independently from this payload.For a failed association, inspect these boundaries in order:
toolType and agentToolId keys.Model Tool Connection Message is intentionally small. Its value is not local computation, but a stable contract that lets the client and server independently evolve their tool-management workflows while retaining a shared machine-to-tool association event.