@openfloor/protocol - v0.0.4
    Preparing search index...

    @openfloor/protocol - v0.0.4

    Open Floor Protocol Logo

    Open Floor Protocol (OFP)

    npm version TypeScript License Docs


    A TypeScript library for the Open Floor Protocol (OFP), enabling interoperable, multi-agent conversational AI.



    The Open Floor Protocol (OFP) is an open standard for multi-agent, multi-party conversational AI interoperability. This library provides a complete, rigorously tested TypeScript implementation of the OFP specifications, including:

    • Conversation Envelope (message container)
    • Dialog Event (utterances, context, etc.)
    • Assistant Manifest (agent capabilities/identity)
    • Agent behaviors (bot, floor manager, convener)

    npm install @openfloor/protocol
    

    You can find more examples and full tutorials on openfloor.dev.

    import { createTextUtterance } from '@openfloor/protocol';

    const utterance = createTextUtterance({
    speakerUri: 'tag:example.com,2025:user1',
    text: 'Hello world',
    to: { speakerUri: 'tag:example.com,2025:bot1' }
    });
    import { createBasicManifest } from '@openfloor/protocol';

    const manifest = createBasicManifest({
    speakerUri: 'tag:example.com,2025:bot1',
    serviceUrl: 'https://example.com/bot',
    name: 'Assistant',
    organization: 'Example Corp',
    description: 'A helpful assistant',
    capabilities: ['chat', 'help']
    });
    import { createSimpleEnvelope } from '@openfloor/protocol';

    const envelope = createSimpleEnvelope({
    conversationId: 'conv:123',
    senderUri: 'tag:example.com,2025:bot1',
    events: [utterance]
    });
    import { validateAndParsePayload } from '@openfloor/protocol';

    const jsonString = JSON.stringify({ openFloor: envelope });
    const result = validateAndParsePayload(jsonString);
    if (result.valid) {
    console.log('Payload is valid:', result.payload);
    } else {
    console.error('Validation errors:', result.errors);
    }

    • OFP enables seamless, cross-platform communication between human users and autonomous agents.
    • Conversation Envelope: Universal JSON structure for agent-to-agent and agent-to-user messages.
    • Dialog Event: Standardized structure for utterances, context, and features.
    • Assistant Manifest: Machine-readable agent identity and capabilities.

    Specifications:

    Schemas:


    • Run tests:
      npm test
      
    • Build:
      npm run build
      
    • Generate docs:
      npm run docs