/** * human-in-the-loop - Primitives for integrating human oversight and intervention in AI workflows * * This package provides primitives for human oversight and intervention in AI workflows: * - Approval gates and workflows * - Review processes and queues * - Escalation paths * - Human intervention points * - Role and team management * - Goals, KPIs, and OKRs tracking * * Implements the digital-workers interface for humans operating within a company boundary. * * @packageDocumentation * @example * ```ts * import { Human, approve, ask, notify } from 'human-in-the-loop' * * // Create a Human-in-the-loop manager * const human = Human({ * defaultTimeout: 3600000, // 1 hour * autoEscalate: true, * }) * * // Request approval * const result = await approve({ * title: 'Deploy to production', * description: 'Approve deployment of v2.0.0', * subject: 'Production Deployment', * assignee: 'tech-lead@example.com', * priority: 'high', * }) * * if (result.approved) { * await deploy() * await notify({ * type: 'success', * title: 'Deployment complete', * message: 'v2.0.0 deployed to production', * recipient: 'team@example.com', * }) * } * ``` */ export { Human, HumanManager } from './human.js'; export { defineRole, defineTeam, defineGoals, approve, ask, do, decide, generate, is, notify, kpis, okrs, registerHuman, getDefaultHuman, } from './helpers.js'; export type { Role, Team, Goal, Goals, KPI, OKR, KeyResult, } from 'org.ai'; export type { BusinessDefinition as Business, Organization as Company, Organization as Org, Organization, OrgTeam, } from 'business-as-code'; /** * Tool, Integration, and Capability types from @org.ai/types. * * These types represent the capabilities and integrations available to workers * and systems in the digital-workers ecosystem: * * - **Tool**: Functions/APIs that agents can invoke to accomplish tasks * - **Integration**: Connections to external services (Stripe, Slack, etc.) * - **Capability**: What a Worker/Agent/Tool can do (read, write, execute, etc.) * * @example * ```typescript * import type { ToolType, IntegrationType, CapabilityType } from 'human-in-the-loop' * import { createTool, createIntegration, createCapability, isTool, isIntegration, isCapability } from 'human-in-the-loop' * * // Create a tool * const searchTool = createTool({ * name: 'web-search', * description: 'Search the web for information', * inputs: [{ name: 'query', type: 'string', required: true }], * outputs: { type: 'object' }, * }) * * // Create an integration * const slackIntegration = createIntegration({ * name: 'slack', * provider: 'slack', * category: 'message', * capabilities: ['send_message', 'read_channel'], * }) * * // Create a capability * const readCapability = createCapability({ * name: 'read-files', * description: 'Read files from the filesystem', * category: 'read', * }) * ``` */ export type { ToolType, ToolParameterType, ToolInputType, ToolOutputType, ToolExecutionResultType, ToolValidationErrorType, ToolValidationResultType, ToolExecutorType, ToolCapabilityType, ExecutableToolType, ValidatableToolType, ToolsType, ToolboxType, ToolId, } from 'org.ai'; export { TOOL_TYPE, StandardToolTypes, StandardCapabilities, Tool, ToolInput, ToolOutput, ToolParameter, ToolExecutionResult, ToolValidationError, ToolValidationResult, ToolExecutor, ExecutableTool, ValidatableTool, Tools, Toolbox, ToolCapability, ToolId as ToolIdMarker, isTool, isToolId, isToolParameter, isToolExecutionResult, isToolValidationError, } from 'org.ai'; export type { IntegrationType, IntegrationStatusType, IntegrationCategoryType, IntegrationId, } from 'org.ai'; export { INTEGRATION_TYPE, IntegrationStatus, IntegrationCategory, Integration, Integrations, IntegrationId as IntegrationIdMarker, IntegrationSchema, isIntegration, isIntegrationId, createIntegration, } from 'org.ai'; export type { CapabilityType, CapabilityCategoryType, CapabilityLevelType, CapabilityId, } from 'org.ai'; export { CAPABILITY_TYPE, CapabilityCategory, CapabilityLevel, Capability, Capabilities, CapabilityId as CapabilityIdMarker, CapabilitySchema, isCapability, isCapabilityId, createCapability, hasCapability, } from 'org.ai'; export { InMemoryHumanStore } from './store.js'; export { InMemoryHumanStore as EnhancedInMemoryStore, createInMemoryStore, } from './stores/in-memory.js'; export type { InMemoryHumanStoreOptions } from './stores/in-memory.js'; export { ExponentialBackoff, HumanRetryPolicy, HumanCircuitBreaker, SLATracker, RetryError, CircuitOpenError, SLAViolationError, withRetry, } from './timeout-retry.js'; export type { BackoffConfig, RetryConfig, CircuitBreakerConfig, SLAConfig, WithRetryOptions, CircuitState, EscalationContext, RetryExhaustedContext, SLAWarningContext, SLAViolationContext, } from './timeout-retry.js'; export { createWebhookRegistry, getDefaultWebhookRegistry, signPayload, verifySignature, } from './webhooks.js'; export type { WebhookRegistry, WebhookConfig, WebhookEvent, WebhookEventType, WebhookRegistryOptions, DeliveryResult, RetryOptions as WebhookRetryOptions, DeadLetterItem, } from './webhooks.js'; export { TierRegistry } from './tier-registry.js'; export type { CascadeTier, TierConfig, TierHandler, TierHandlerResult, TierMetrics, FailureType, FailurePattern, FailureInfo, PriorityMapping, } from './tier-registry.js'; export { DecisionLogger, FeedbackLoop, FallbackChain, DecisionAnalytics, } from './fallback-resolution.js'; export { AIFailureClassifier, ContextSanitizer, AutoEscalationTrigger, EscalationRouter, } from './ai-failure-escalation.js'; export type { AIFailure, FailureCategory, FailureSeverity, CascadeTierId, FailureTypeConfig, CategoryRule, SanitizedContext, ContextSanitizerOptions, EscalationConfig, EscalationEvent, FailureRecord, EscalationRoute, ReviewerConfig, RoutingMetrics, EscalationRequestParams, CreatedEscalationRequest, } from './ai-failure-escalation.js'; export type { DecisionContext, DecisionLog, LogDecisionInput, ComplianceReportFilters, ComplianceReport, FeedbackSignal, GenerateSignalInput, TrainingBatch, AccuracyMetrics, FallbackHandler, EscalationRecord, EscalationAudit, ExecuteWithFallbackResult, DecisionPattern, TimePatterns, DashboardData, } from './fallback-resolution.js'; export { chatSdkAdapter, defaultChannelAdapter } from './chat-sdk-adapter.js'; export type { ChatBotLike, ChatThreadLike, ChatMessageLike, ChatSdkAdapterOptions, } from './chat-sdk-adapter.js'; export type { ChannelAdapter, ChannelKind, Subscription, IdentityRef } from './types.js'; export { claim, startProgress, release, resolve, timeout, escalate, cancel, forAssignee, sortByPriorityThenSLA, timeToDeadline, isBreached, LEGACY_KIND_MAP, legacyKindToRequestKind, } from './request-lifecycle.js'; export type { RequestKind, LegacyRequestKind, LifecycleStatus, LifecyclePriority, ArtifactRef, CascadeRef, Resolution, LifecycleItem, ClaimInput, StartProgressInput, ReleaseInput, ResolveInput, TimeoutInput, EscalateInput, CancelInput, } from './request-lifecycle.js'; export { evaluateEscalation, batchEvaluate, buildEscalatedItem, buildVantageLadder, FIXTURE_IC, FIXTURE_TEAM, FIXTURE_BUSINESS, FIXTURE_STUDIO, FIXTURE_POLICIES, getFixturePolicy, } from './escalation-engine.js'; export type { AssigneeRef, EscalationLevel, EscalationPolicy as LifecycleEscalationPolicy, EscalationDecision, } from './escalation-engine.js'; export type { HumanRequestStatus, Priority, Human as HumanType, KPIs, OKRs, HumanRequest, ApprovalRequest, ApprovalResponse, QuestionRequest, TaskRequest, DecisionRequest, ReviewRequest, ReviewResponse, Notification, ReviewQueue, EscalationPolicy, ApprovalWorkflow, HumanStore, HumanOptions, RetryOptions, CircuitBreakerOptions, SLAOptions, } from './types.js'; export type { LifecycleStoreFilters, LifecycleItemPatch, LifecycleResponse, LifecycleStore, } from './lifecycle-store.js'; export { LifecycleStoreMemory } from './lifecycle-store-memory.js'; export type { LifecycleChannelKind, LifecycleChannelAdapter } from './lifecycle-channel-adapter.js'; export { LifecycleAdapterRegistry, adapterRegistry } from './lifecycle-channel-adapter.js'; export { emailAdapter } from './adapters/email-adapter.js'; export { slackAdapter } from './adapters/slack-adapter.js'; //# sourceMappingURL=index.d.ts.map