OpenAgentID documentation
Source referencesTypeScript reference

@openagentid/scim API

Exported TypeScript types, signatures and source documentation.

Package manifest, subpaths, and integration guide.

This reference resolves exported symbols from the package entry point with the TypeScript parser/type checker. It includes declarations and inferred types, not implementation bodies. External dependencies unavailable to the extraction environment can remain unresolved; this is source documentation, not proof that all packages typecheck or are published.

createScimRouter

Create a SCIM 2.0 router with the given configuration.

export declare const createScimRouter: (routerConfig?: ScimRouterConfig) => ScimRouter;

Source: openagent-sdk/bridges/scim/typescript/src/server.ts:52.

ScimRouter

export interface ScimRouter {
    /** Handle a WHATWG Request and return a WHATWG Response. */
    handle(request: Request): Promise<Response>;
}

Source: openagent-sdk/bridges/scim/typescript/src/server.ts:44.

ScimRouterConfig

// ── Router configuration ──────────────────────────────────────────────────
export interface ScimRouterConfig extends ScimBridgeConfig {
    /** Custom agent store. Defaults to in-memory. */
    readonly store?: AgentStore;
    /** Audit event sink. */
    readonly auditSink?: AuditSink;
    /** DID revocation hook (production: OAS SDK). */
    readonly revokeDidDocument?: DidRevoker;
    /** Delegation cascade revocation hook (production: AEGIS SDK). */
    readonly cascadeRevokeDelegations?: DelegationCascadeRevoker;
    /** Arsenal session invalidation hook (production: Arsenal SDK). */
    readonly invalidateArsenalSessions?: ArsenalSessionInvalidator;
}

Source: openagent-sdk/bridges/scim/typescript/src/server.ts:31.

ScimBridgeConfig

Configuration for the SCIM provisioning bridge.

/** Configuration for the SCIM provisioning bridge. */
export interface ScimBridgeConfig {
    /**
     * OAS namespace for generated DIDs. Defaults to `l1fe`.
     */
    readonly namespace?: string;
    /**
     * Bearer token(s) that SCIM clients must present.
     * When undefined, authentication is disabled (dev only).
     */
    readonly bearerTokens?: readonly string[];
    /**
     * Base URL for SCIM resource `meta.location` fields.
     * Example: `https://scim.example.com/scim/v2`
     */
    readonly baseUrl?: string;
    /** Maximum page size for list responses. Default: 100. */
    readonly maxPageSize?: number;
    /** Structured logger. */
    readonly logger?: Logger;
}

Source: openagent-sdk/bridges/scim/typescript/src/config.ts:25.

ResolvedScimConfig

export interface ResolvedScimConfig {
    readonly namespace: string;
    readonly bearerTokens: readonly string[];
    readonly baseUrl: string;
    readonly maxPageSize: number;
    readonly logger: Logger;
}

Source: openagent-sdk/bridges/scim/typescript/src/config.ts:59.

Logger

Logger interface matching the OpenAgent SDK convention.

/** Logger interface matching the OpenAgent SDK convention. */
export interface Logger {
    debug(msg: string, fields?: Record<string, unknown>): void;
    info(msg: string, fields?: Record<string, unknown>): void;
    warn(msg: string, fields?: Record<string, unknown>): void;
    error(msg: string, fields?: Record<string, unknown>): void;
}

Source: openagent-sdk/bridges/scim/typescript/src/config.ts:10.

resolveScimConfig

export declare const resolveScimConfig: (config?: ScimBridgeConfig) => ResolvedScimConfig;

Source: openagent-sdk/bridges/scim/typescript/src/config.ts:67.

silentLogger

export declare const silentLogger: Logger;

Source: openagent-sdk/bridges/scim/typescript/src/config.ts:17.

SCIM_USER_SCHEMA

SCIM core User schema URN.

export declare const SCIM_USER_SCHEMA: "urn:ietf:params:scim:schemas:core:2.0:User";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:9.

OPENAGENT_AGENT_SCHEMA

OpenAgent agent extension schema URN.

export declare const OPENAGENT_AGENT_SCHEMA: "urn:openagent:scim:1.0:Agent";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:12.

SCIM_LIST_RESPONSE_SCHEMA

SCIM List Response schema URN.

export declare const SCIM_LIST_RESPONSE_SCHEMA: "urn:ietf:params:scim:api:messages:2.0:ListResponse";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:15.

SCIM_ERROR_SCHEMA

SCIM Error schema URN.

export declare const SCIM_ERROR_SCHEMA: "urn:ietf:params:scim:api:messages:2.0:Error";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:18.

SCIM_PATCH_OP_SCHEMA

SCIM Patch Operation schema URN.

export declare const SCIM_PATCH_OP_SCHEMA: "urn:ietf:params:scim:api:messages:2.0:PatchOp";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:21.

SCIM_SPC_SCHEMA

SCIM ServiceProviderConfig schema URN.

export declare const SCIM_SPC_SCHEMA: "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:24.

SCIM_SCHEMA_SCHEMA

SCIM Schema schema URN.

export declare const SCIM_SCHEMA_SCHEMA: "urn:ietf:params:scim:schemas:core:2.0:Schema";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:27.

SCIM_RESOURCE_TYPE_SCHEMA

SCIM ResourceType schema URN.

export declare const SCIM_RESOURCE_TYPE_SCHEMA: "urn:ietf:params:scim:schemas:core:2.0:ResourceType";

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:30.

ConformanceLevel

Conformance levels for OpenAgent agents.

/** Conformance levels for OpenAgent agents. */
export type ConformanceLevel = 'L0' | 'L1' | 'L2';

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:33.

AgentExtension

The OpenAgent agent extension attribute group.

/** The OpenAgent agent extension attribute group. */
export interface AgentExtension {
    readonly parentDid: string;
    readonly conformanceLevel: ConformanceLevel;
    readonly scopes: readonly string[];
    readonly lineageDepth: number;
    readonly createdVia: string;
    readonly keypairFingerprint: string;
}

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:36.

ScimAgentResource

Full SCIM User resource with agent extension.

/** Full SCIM User resource with agent extension. */
export interface ScimAgentResource {
    readonly schemas: readonly string[];
    readonly id: string;
    readonly externalId?: string;
    readonly userName: string;
    readonly displayName: string;
    readonly active: boolean;
    readonly meta: ScimMeta;
    readonly [OPENAGENT_AGENT_SCHEMA]: AgentExtension;
}

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:46.

ScimMeta

SCIM resource metadata.

/** SCIM resource metadata. */
export interface ScimMeta {
    readonly resourceType: string;
    readonly created: string;
    readonly lastModified: string;
    readonly location: string;
    readonly version: string;
}

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:58.

ScimListResponse

SCIM List Response envelope.

/** SCIM List Response envelope. */
export interface ScimListResponse<T> {
    readonly schemas: readonly string[];
    readonly totalResults: number;
    readonly startIndex: number;
    readonly itemsPerPage: number;
    readonly Resources: readonly T[];
}

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:67.

ScimErrorResponse

SCIM Error response.

/** SCIM Error response. */
export interface ScimErrorResponse {
    readonly schemas: readonly string[];
    readonly status: string;
    readonly scimType?: string;
    readonly detail: string;
}

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:76.

buildServiceProviderConfig

Service Provider Configuration response.

export declare const buildServiceProviderConfig: (baseUrl: string) => Record<string, unknown>;

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:84.

buildSchemas

Schema discovery response for the User + Agent extension.

export declare const buildSchemas: () => readonly Record<string, unknown>[];

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:111.

buildResourceTypes

Resource type discovery for User (Agent).

export declare const buildResourceTypes: (baseUrl: string) => readonly Record<string, unknown>[];

Source: openagent-sdk/bridges/scim/typescript/src/schemas.ts:144.

AgentRecord

The canonical internal representation of a provisioned agent.

// ── Internal agent record ─────────────────────────────────────────────────
/** The canonical internal representation of a provisioned agent. */
export interface AgentRecord {
    readonly did: string;
    readonly userName: string;
    readonly displayName: string;
    readonly active: boolean;
    readonly parentDid: string;
    readonly conformanceLevel: ConformanceLevel;
    readonly scopes: readonly string[];
    readonly lineageDepth: number;
    readonly createdVia: string;
    readonly keypairFingerprint: string;
    readonly createdAt: string;
    readonly updatedAt: string;
    readonly version: string;
    readonly externalId?: string;
}

Source: openagent-sdk/bridges/scim/typescript/src/resources.ts:22.

CreateAgentFromScimInput

export type CreateAgentFromScimInput = z.infer<typeof createAgentFromScimSchema>;

Source: openagent-sdk/bridges/scim/typescript/src/resources.ts:65.

ReplaceAgentFromScimInput

export type ReplaceAgentFromScimInput = z.infer<typeof replaceAgentFromScimSchema>;

Source: openagent-sdk/bridges/scim/typescript/src/resources.ts:68.

agentToScimResource

Convert an internal AgentRecord into a SCIM User resource.

export declare const agentToScimResource: (agent: AgentRecord, baseUrl: string) => ScimAgentResource;

Source: openagent-sdk/bridges/scim/typescript/src/resources.ts:73.

parseCreateInput

Parse and validate a SCIM create request body into typed input.

export declare const parseCreateInput: (body: unknown) => CreateAgentFromScimInput;

Source: openagent-sdk/bridges/scim/typescript/src/resources.ts:107.

parseReplaceInput

Parse and validate a SCIM replace (PUT) request body into typed input.

export declare const parseReplaceInput: (body: unknown) => ReplaceAgentFromScimInput;

Source: openagent-sdk/bridges/scim/typescript/src/resources.ts:112.

createAgentFromScimSchema

export declare const createAgentFromScimSchema: z.ZodObject<{ schemas: z.ZodArray<z.ZodString>; externalId: z.ZodOptional<z.ZodString>; userName: z.ZodString; displayName: z.ZodOptional<z.ZodString>; active: z.ZodDefault<z.ZodBoolean>; "urn:openagent:scim:1.0:Agent": z.ZodObject<{ parentDid: z.ZodString; conformanceLevel: z.ZodDefault<z.ZodEnum<{ L0: "L0"; L1: "L1"; L2: "L2"; }>>; scopes: z.ZodArray<z.ZodString>; lineageDepth: z.ZodOptional<z.ZodNumber>; createdVia: z.ZodOptional<z.ZodString>; keypairFingerprint: z.ZodOptional<z.ZodString>; }, z.core.$strip>; }, z.core.$strip>;

Source: openagent-sdk/bridges/scim/typescript/src/resources.ts:53.

ParsedFilter

export type ParsedFilter = AttributeFilter | LogicalFilter;

Source: openagent-sdk/bridges/scim/typescript/src/filtering.ts:34.

AttributeFilter

A single attribute filter expression.

/** A single attribute filter expression. */
export interface AttributeFilter {
    readonly type: 'attribute';
    readonly attribute: string;
    readonly op: FilterOp;
    readonly value: string | boolean | number | null;
}

Source: openagent-sdk/bridges/scim/typescript/src/filtering.ts:21.

LogicalFilter

Logical combination of filters.

/** Logical combination of filters. */
export interface LogicalFilter {
    readonly type: 'and' | 'or';
    readonly filters: readonly ParsedFilter[];
}

Source: openagent-sdk/bridges/scim/typescript/src/filtering.ts:29.

FilterOp

Supported comparison operators.

/** Supported comparison operators. */
export type FilterOp = 'eq' | 'ne' | 'co' | 'sw' | 'ew' | 'pr' | 'gt' | 'ge' | 'lt' | 'le';

Source: openagent-sdk/bridges/scim/typescript/src/filtering.ts:18.

parseFilter

Parse a SCIM filter string into a structured filter tree.

Returns undefined for empty/missing filters (match all). Throws on malformed filters.

export declare const parseFilter: (filterStr: string | undefined | null) => ParsedFilter | undefined;

Source: openagent-sdk/bridges/scim/typescript/src/filtering.ts:109.

matchesFilter

Evaluate a parsed filter against an agent record. Returns true if the record matches.

export declare const matchesFilter: (record: AgentRecord, filter: ParsedFilter | undefined) => boolean;

Source: openagent-sdk/bridges/scim/typescript/src/filtering.ts:206.

ScimFilterError

export declare class ScimFilterError {
  constructor(message: string): ScimFilterError;
}

Source: openagent-sdk/bridges/scim/typescript/src/filtering.ts:278.

PaginationParams

Parsed pagination parameters from a SCIM request.

/** Parsed pagination parameters from a SCIM request. */
export interface PaginationParams {
    /** 1-based start index. */
    readonly startIndex: number;
    /** Number of results to return. */
    readonly count: number;
}

Source: openagent-sdk/bridges/scim/typescript/src/pagination.ts:11.

parsePagination

Extract pagination parameters from a SCIM request URL search params.

Returns immutable params — never mutates the input.

export declare const parsePagination: (searchParams: URLSearchParams, maxPageSize: number) => PaginationParams;

Source: openagent-sdk/bridges/scim/typescript/src/pagination.ts:23.

paginateResults

Apply pagination to an array of items and return a SCIM ListResponse.

Items are expected to be pre-filtered and pre-sorted. This function slices the array according to 1-based SCIM indexing.

export declare const paginateResults: <T>(items: readonly T[], params: PaginationParams) => ScimListResponse<T>;

Source: openagent-sdk/bridges/scim/typescript/src/pagination.ts:43.

PatchOperation

A single SCIM PATCH operation.

/** A single SCIM PATCH operation. */
export interface PatchOperation {
    readonly op: 'add' | 'replace' | 'remove';
    readonly path?: string;
    readonly value?: unknown;
}

Source: openagent-sdk/bridges/scim/typescript/src/operations.ts:13.

PatchRequest

SCIM PatchOp request body.

/** SCIM PatchOp request body. */
export interface PatchRequest {
    readonly schemas: readonly string[];
    readonly Operations: readonly PatchOperation[];
}

Source: openagent-sdk/bridges/scim/typescript/src/operations.ts:20.

parsePatchRequest

Parse and validate a SCIM PATCH request body.

export declare const parsePatchRequest: (body: unknown) => PatchRequest;

Source: openagent-sdk/bridges/scim/typescript/src/operations.ts:40.

applyPatchOperations

Apply a set of SCIM PATCH operations to an agent record.

Returns a new record with all operations applied. The original is never mutated. Throws on invalid paths or unsupported operations.

export declare const applyPatchOperations: (record: AgentRecord, operations: readonly PatchOperation[]) => AgentRecord;

Source: openagent-sdk/bridges/scim/typescript/src/operations.ts:50.

ScimPatchError

export declare class ScimPatchError {
  constructor(message: string): ScimPatchError;
}

Source: openagent-sdk/bridges/scim/typescript/src/operations.ts:170.

AgentProvisioner

export declare class AgentProvisioner {
  constructor(config: ProvisionerConfig): AgentProvisioner;
  createAgent(params: CreateAgentParams): Promise<AgentRecord>;
  replaceAgent(did: string, params: CreateAgentParams): Promise<AgentRecord>;
  updateAgent(did: string, record: AgentRecord): Promise<AgentRecord>;
  deprovisionAgent(did: string): Promise<void>;
  findByDid(did: string): Promise<AgentRecord | undefined>;
  findByUserName(userName: string): Promise<AgentRecord | undefined>;
  listAgents(): Promise<readonly AgentRecord[]>;
}

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:83.

ProvisionerConfig

// ── Provisioner configuration ─────────────────────────────────────────────
export interface ProvisionerConfig {
    readonly store: AgentStore;
    readonly namespace: string;
    readonly logger: Logger;
    readonly auditSink?: AuditSink;
    readonly revokeDidDocument?: DidRevoker;
    readonly cascadeRevokeDelegations?: DelegationCascadeRevoker;
    readonly invalidateArsenalSessions?: ArsenalSessionInvalidator;
}

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:60.

CreateAgentParams

// ── Create ────────────────────────────────────────────────────────────────
export interface CreateAgentParams {
    readonly userName: string;
    readonly displayName?: string;
    readonly parentDid: string;
    readonly conformanceLevel: ConformanceLevel;
    readonly scopes: readonly string[];
    readonly externalId?: string;
}

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:72.

AuditEvent

Audit event emitted during agent lifecycle operations.

// ── Event types ───────────────────────────────────────────────────────────
/** Audit event emitted during agent lifecycle operations. */
export interface AuditEvent {
    readonly type: 'agent.created' | 'agent.updated' | 'agent.deprovisioned';
    readonly did: string;
    readonly timestamp: string;
    readonly details: Record<string, unknown>;
}

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:20.

AuditSink

Callback invoked for each lifecycle audit event.

/** Callback invoked for each lifecycle audit event. */
export type AuditSink = (event: AuditEvent) => void | Promise<void>;

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:28.

DidRevoker

Hook invoked during deprovisioning to revoke the agent's DID document.

Production: wires to OAS SDK's revokeIdentity. Default: no-op (logs a warning).

// ── Deprovisioning hooks ──────────────────────────────────────────────────
/**
 * Hook invoked during deprovisioning to revoke the agent's DID document.
 *
 * Production: wires to OAS SDK's `revokeIdentity`.
 * Default: no-op (logs a warning).
 */
export type DidRevoker = (did: string) => Promise<void>;

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:38.

DelegationCascadeRevoker

Hook invoked during deprovisioning to cascade-revoke all delegation proofs issued by (or to) the deprovisioned agent.

Production: wires to AEGIS SDK's delegation tree walker. Default: no-op (logs a warning).

/**
 * Hook invoked during deprovisioning to cascade-revoke all delegation
 * proofs issued by (or to) the deprovisioned agent.
 *
 * Production: wires to AEGIS SDK's delegation tree walker.
 * Default: no-op (logs a warning).
 */
export type DelegationCascadeRevoker = (did: string) => Promise<void>;

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:47.

ArsenalSessionInvalidator

Hook invoked during deprovisioning to invalidate all active Arsenal sessions for the deprovisioned agent.

Production: wires to Arsenal SDK's session invalidation. Default: no-op (logs a warning).

/**
 * Hook invoked during deprovisioning to invalidate all active Arsenal
 * sessions for the deprovisioned agent.
 *
 * Production: wires to Arsenal SDK's session invalidation.
 * Default: no-op (logs a warning).
 */
export type ArsenalSessionInvalidator = (did: string) => Promise<void>;

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:56.

ProvisionerError

export declare class ProvisionerError {
  code: ProvisionerErrorCode;
  constructor(message: string, code: ProvisionerErrorCode): ProvisionerError;
}

Source: openagent-sdk/bridges/scim/typescript/src/provisioner.ts:341.

AgentStore

Storage interface for agent records.

All methods return new objects — implementations must never return mutable references to internal state.

/**
 * Storage interface for agent records.
 *
 * All methods return new objects — implementations must never return
 * mutable references to internal state.
 */
export interface AgentStore {
    /** List all agent records. Returns an immutable snapshot. */
    list(): Promise<readonly AgentRecord[]>;
    /** Find agent by DID. Returns undefined if not found. */
    findByDid(did: string): Promise<AgentRecord | undefined>;
    /** Find agent by userName. Returns undefined if not found. */
    findByUserName(userName: string): Promise<AgentRecord | undefined>;
    /** Find agent by externalId. Returns undefined if not found. */
    findByExternalId(externalId: string): Promise<AgentRecord | undefined>;
    /** Insert a new agent record. Throws if DID already exists. */
    create(record: AgentRecord): Promise<AgentRecord>;
    /** Replace an agent record. Throws if DID does not exist. */
    update(did: string, record: AgentRecord): Promise<AgentRecord>;
    /** Delete an agent record. Throws if DID does not exist. */
    delete(did: string): Promise<void>;
    /** Return the count of all active agents. */
    countActive(): Promise<number>;
}

Source: openagent-sdk/bridges/scim/typescript/src/store.ts:17.

InMemoryAgentStore

In-memory store for testing and development.

export declare class InMemoryAgentStore {
  list(): Promise<readonly AgentRecord[]>;
  findByDid(did: string): Promise<AgentRecord | undefined>;
  findByUserName(userName: string): Promise<AgentRecord | undefined>;
  findByExternalId(externalId: string): Promise<AgentRecord | undefined>;
  create(record: AgentRecord): Promise<AgentRecord>;
  update(did: string, record: AgentRecord): Promise<AgentRecord>;
  delete(did: string): Promise<void>;
  countActive(): Promise<number>;
}

Source: openagent-sdk/bridges/scim/typescript/src/store.ts:44.

StoreError

export declare class StoreError {
  code: StoreErrorCode;
  constructor(message: string, code: StoreErrorCode): StoreError;
}

Source: openagent-sdk/bridges/scim/typescript/src/store.ts:106.

StoreErrorCode

export type StoreErrorCode = 'NOT_FOUND' | 'CONFLICT' | 'INTERNAL';

Source: openagent-sdk/bridges/scim/typescript/src/store.ts:104.

VERSION

Package version.

export declare const VERSION: "0.1.1";

Source: openagent-sdk/bridges/scim/typescript/src/index.ts:120.

On this page