Skip to content

Faimulus TypeScript API / @faimulus/driver-sdk

@faimulus/driver-sdk ​

TypeScript contracts for extending Faimulus with AI provider, memory, toolset, and channel drivers.

The package contains interfaces and types only. Driver implementations remain in your application workspace and are loaded by the Faimulus runtime.

Installation ​

sh
npm install @faimulus/driver-sdk

Driver definitions ​

Import the contract for the driver type you are implementing:

ts
import {
  AiProviderDefinition,
  ChannelDriverDefinition,
  MemoryDriverDefinition,
  Toolset,
} from "@faimulus/driver-sdk";

An AI provider driver, for example, exports a definition that creates models from validated configuration:

ts
import type { AiProviderDefinition } from "@faimulus/driver-sdk";

export const provider: AiProviderDefinition = {
  type: "example",
  displayName: "Example AI",
  configSchema: {
    type: "object",
    additionalProperties: false,
  },
  async createModel(config) {
    return {
      async execute(request) {
        return { input: request.input, config };
      },
    };
  },
};

Workspace driver manifests target SDK API version 1. Keep the SDK version used to compile a driver compatible with the Faimulus runtime that loads it.

Agent-capable provider drivers receive provider-neutral AgentMessage values. A tool result includes toolCallId, the workflow-visible tool name, and serialized content; adapters must preserve the call ID and translate the name to the provider's wire format.

For complete implementations, see the sample app:

  • OpenAI provider
  • Anthropic provider
  • Google provider
  • OpenAI-compatible provider
  • File memory

Faimulus ecosystem ​

License ​

Apache-2.0

Interfaces ​

Type Aliases ​

Variables ​

Documentation for the current repository state.