{
  "name": "@forge-sdk/comm",
  "language": "typescript",
  "version": "0.1.0",
  "description": "ANVIL Communication Contract: message transport, envelopes, and protocol negotiation",
  "manifest": "forge-ts/packages/forge-comm/package.json",
  "manifestSha256": "ced17f3ed7a29daabe39e2b8d8d5b763da46a66786b21ff74dd81e6eba091a6a",
  "status": "source-reference",
  "registryPublicationVerified": false,
  "route": "/libraries/typescript/comm",
  "features": {},
  "files": [
    {
      "path": "forge-ts/packages/forge-comm/src/error.ts",
      "sha256": "bd33ef247042b3128578bcf2f8c27561a12caeec5bf5a924ca24cdb80ea08126",
      "artifactSha256": "1e58ffb797968eeb356c2e3e74280567a098766fbcf1cde18b018f72e8ca2523",
      "url": "/reference/source/forge-ts/packages/forge-comm/src/error.ts.txt",
      "declarations": [
        {
          "name": "export const CommErrorCode = {",
          "line": 18,
          "signature": "export const CommErrorCode /* type inferred in source */;",
          "documentation": "Error types for the forge-comm package.\n\nAll errors are typed, actionable, and include enough context to diagnose\nissues without reading source code.\n\nANVIL Spec section 10 -- Communication Contract.\nError codes for communication operations.\n\nEach code maps to a specific category of failure in the message\ntransport, serialization, protocol negotiation, or channel lifecycle."
        },
        {
          "name": "CommErrorCodeType",
          "line": 40,
          "signature": "export type CommErrorCodeType =\n  (typeof CommErrorCode)[keyof typeof CommErrorCode];",
          "documentation": "A communication error code value."
        },
        {
          "name": "CommError",
          "line": 55,
          "signature": "export class CommError extends Error {\n  readonly code: CommErrorCodeType;\n  static serializationFailed(reason: string): CommError;\n  static deserializationFailed(reason: string): CommError;\n  static transportFailed(reason: string): CommError;\n  static notConnected(): CommError;\n  static channelClosed(): CommError;\n  static signatureInvalid(sender: string): CommError;\n  static protocolNegotiationFailed(offered: string, reason: string): CommError;\n  static messageTooLarge(size: number, maxSize: number): CommError;\n  static timeout(durationMs: number): CommError;\n}",
          "documentation": "Error type for communication, transport, and protocol negotiation operations.\n\nEvery instance includes actionable context: what failed, why, and what\nthe developer should check."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-comm/src/index.ts",
      "sha256": "6df6fcc633c38e81db92ea7e6e728bd496440692089dbed402b6a640aba04083",
      "artifactSha256": "cdb0d3ab7d0827fb9dd40d72ee319e8ae594b25cd3ba0b71c8fb3ffbe69dbfe3",
      "url": "/reference/source/forge-ts/packages/forge-comm/src/index.ts.txt",
      "declarations": [
        {
          "name": "export { AgentMessage } from './message.js';",
          "line": 23,
          "signature": "export { AgentMessage } from './message.js';",
          "documentation": ""
        },
        {
          "name": "export { type MessageTransport, NoopTransport } from './transport.js';",
          "line": 26,
          "signature": "export { type MessageTransport, NoopTransport } from './transport.js';",
          "documentation": ""
        },
        {
          "name": "export {",
          "line": 29,
          "signature": "export {\n  type ProtocolOffer,\n  type ProtocolAccept,\n  negotiateProtocol,\n} from './protocol.js';",
          "documentation": ""
        },
        {
          "name": "export {",
          "line": 36,
          "signature": "export {\n  CommErrorCode,\n  type CommErrorCodeType,\n  CommError,\n} from './error.js';",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-comm/src/message.ts",
      "sha256": "e51cae81b671651a78e0e4c940f38235a9872c3923f313afe0f4298de5ad29e8",
      "artifactSha256": "fbe0dbc69e480592c73719823481c55994e1250a67306fe94c937a8215d93296",
      "url": "/reference/source/forge-ts/packages/forge-comm/src/message.ts.txt",
      "declarations": [
        {
          "name": "AgentMessage",
          "line": 46,
          "signature": "export class AgentMessage {\n  readonly id: string;\n  readonly correlationId: string | undefined;\n  readonly replyTo: string | undefined;\n  readonly sender: string;\n  readonly recipient: string;\n  readonly protocol: string;\n  readonly messageType: string;\n  readonly payload: unknown;\n  readonly signature: string | undefined;\n  readonly timestamp: string;\n  static create(\n    sender: string,\n    recipient: string,\n    protocol: string,\n    messageType: string,\n    payload: unknown\n  ): AgentMessage;\n  kind(): string;\n  isSigned(): boolean;\n  withCorrelationId(id: string): AgentMessage;\n  withReplyTo(id: string): AgentMessage;\n  withSignature(sig: string): AgentMessage;\n  toJSON(): Record<string, unknown>;\n}",
          "documentation": "An agent message envelope per ANVIL Spec section 10.2.\n\nThe AgentMessage is the fundamental unit of inter-agent communication.\nIt wraps a JSON payload with routing metadata (sender/recipient DIDs),\nprotocol identification, correlation tracking, and an optional\ncryptographic signature for integrity verification."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-comm/src/protocol.ts",
      "sha256": "5e4956a7fb9cd79747123256861dd9f58148ff445fa5965d992eb5e6e303a801",
      "artifactSha256": "36ad0a140f0b3355ad39c5fb1d9fc61ce8db5e4f3a1ca82e0c7625e30295832a",
      "url": "/reference/source/forge-ts/packages/forge-comm/src/protocol.ts.txt",
      "declarations": [
        {
          "name": "ProtocolOffer",
          "line": 34,
          "signature": "export interface ProtocolOffer {\n  /** The protocol identifier (e.g., \"anvil.task\"). */\n  readonly protocol: string;\n  /** The versions the offering agent supports, ordered by preference. */\n  readonly versions: readonly string[];\n  /** Optional extensions the offering agent supports. */\n  readonly extensions: readonly string[];\n}",
          "documentation": "A protocol version offer sent during negotiation.\n\nThe offering agent lists all protocol versions it supports, ordered\nby preference (first is most preferred). Extensions are optional\ncapabilities the offering agent supports within the protocol.\n\nANVIL Spec section 10.5 -- Protocol Negotiation."
        },
        {
          "name": "ProtocolAccept",
          "line": 60,
          "signature": "export interface ProtocolAccept {\n  /** The agreed-upon protocol identifier. */\n  readonly protocol: string;\n  /** The agreed-upon version string. */\n  readonly version: string;\n  /** The extensions active for this protocol session. */\n  readonly extensions: readonly string[];\n}",
          "documentation": "An accepted protocol version resulting from successful negotiation.\n\nContains the agreed-upon protocol, version, and the extensions\nfrom the offer.\n\nANVIL Spec section 10.5 -- Protocol Negotiation."
        },
        {
          "name": "negotiateProtocol",
          "line": 96,
          "signature": "export function negotiateProtocol(\n  offered: ProtocolOffer,\n  supportedVersions: readonly string[]\n): ProtocolAccept;",
          "documentation": "Negotiate the best matching protocol version between offered and supported.\n\nExamines the offered versions and selects the highest one (by position\nin supportedVersions) that appears in both the offer and the supported\nlist. \"Highest\" means the last matching entry in supportedVersions,\nwhich should be ordered from oldest to newest."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-comm/src/transport.ts",
      "sha256": "fb518ee88e8c921c5a5da36db174ab0b2997baff0194ed44f858cdbfd9ba82d4",
      "artifactSha256": "537af5110609488ca51ee29c99e1b5613d90b436c3439aa1905b4f21435aef51",
      "url": "/reference/source/forge-ts/packages/forge-comm/src/transport.ts.txt",
      "declarations": [
        {
          "name": "MessageTransport",
          "line": 27,
          "signature": "export interface MessageTransport {\n  /**\n   * Send a message to the recipient identified in the message envelope.\n   *\n   * @param message - The agent message envelope to send.\n   * @throws {CommError} If the transport fails, channel is closed, or message is too large.\n   */\n  send(message: AgentMessage): Promise<void>;\n\n  /**\n   * Receive the next available message.\n   *\n   * @returns The next AgentMessage from the transport.\n   * @throws {CommError} If the transport is not connected, channel is closed, or transport fails.\n   */\n  receive(): Promise<AgentMessage>;\n}",
          "documentation": "The message transport contract for ANVIL-compliant agent communication.\n\nImplementations of this interface provide the mechanism by which agents\nexchange AgentMessage envelopes. The interface is intentionally minimal:\nsend a message, receive a message. Higher-level concerns (protocol\nnegotiation, message routing, retry logic) are handled by upper layers.\n\nANVIL Spec section 10.1 -- Communication Contract."
        },
        {
          "name": "NoopTransport",
          "line": 62,
          "signature": "export class NoopTransport implements MessageTransport {\n  async send(_message: AgentMessage): Promise<void>;\n  async receive(): Promise<AgentMessage>;\n}",
          "documentation": "No-op transport for standalone agents.\n\nSilently drops sent messages and throws NotConnected on receive.\nUsed as the default transport for agents that do not participate\nin inter-agent communication.\n\nANVIL Spec section 10.1 -- Communication Contract (default transport)."
        }
      ]
    }
  ]
}
