Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

2.5 KB
Raw Blame
// This file has been generated by Specta. Do not edit this file manually.
/**
 *  One complete ACP JSON-RPC message routed between the Agent Service and the
 *  single agent execution hosted by this connection.
 *
 *  Its own JSON-RPC fields are opaque to TypeScript consumers here (typed as
 *  an arbitrary object of unknown values): they already have a proper ACP SDK
 *  on the TypeScript side, so this crate only needs to guarantee the message
 *  round-trips unchanged. This is typed as a map rather than plain `unknown`
 *  because [`ToRuntimeMessage`]/[`ToServerMessage`] carry it in an internally
 *  tagged `Acp` variant, which requires its payload provably serialize as an
 *  object so the `"type"` tag can be merged into it. `#[serde(transparent)]`
 *  changes nothing about the actual wire format here - a single-field tuple
 *  struct already serializes transparently by default - but it does tell
 *  specta's serde-compatibility checker that this newtype is transparent, so
 *  it looks through to the map type below instead of treating `AcpMessage`
 *  itself as an opaque, non-mergeable struct.
 */
export type AcpMessage = { [key in string]: unknown };

/**  The result of probing a fresh ACP subprocess. */
export type ModelProbeResult =
/**  The raw options returned by `session/new`. */
{ status: "available";
/**  Session configuration options exactly as the agent returned them. */
configOptions: unknown[] } |
/**  A safe, operator-actionable failure description. */
{ status: "error";
/**  Failure text safe to return across the runtime connection. */
message: string };

/**  Agent Service to Agent Runtime traffic on the logical protocol stream. */
export type ToRuntimeMessage =
/**  An ACP message routed to the hosted agent. */
{
	type: "acp",
} & AcpMessage |
/**
 *  Probe a separate fresh agent process for its session configuration.
 *
 *  The request carries no parameters: it asks this connection's one
 *  configured harness what it advertises. Answers are therefore
 *  interchangeable, so nothing correlates a response to a request.
 */
{ type: "modelProbeRequest" };

/**  Agent Runtime to Agent Service traffic on the logical protocol stream. */
export type ToServerMessage =
/**  An ACP message routed from the hosted agent. */
{
	type: "acp",
} & AcpMessage |
/**  A runtime or agent lifecycle event. */
({ type: "event";
/**  The event name. */
event: string }) & { result?: never } |
/**  An answer to a connection-level model probe. */
({ type: "modelProbeResponse";
/**  Raw options or a safe failure. */
result: ModelProbeResult }) & { event?: never };