ports library
Port Contracts - Unified interfaces for MCP ecosystem.
This library exports all port contracts defined in mcp_bundle. Use this for accessing LLM, storage, metric, and event ports.
Example:
import 'package:mcp_bundle/ports.dart';
class MyLlmAdapter extends LlmPort {
@override
LlmCapabilities get capabilities => const LlmCapabilities.full();
@override
Future<LlmResponse> complete(LlmRequest request) async {
// Implementation
}
}
Classes
- AbsolutePeriod
- Absolute period - a fixed date range.
- AdapterManifest
- Manifest describing an IO adapter's identity, capabilities, and constraints.
- AnalysisAlert
- Evaluated alert result indicating whether a condition was triggered.
- AnalysisAlertRuleArtifact
- Artifact defining an alert rule with condition and severity.
- AnalysisArtifact
- Base class for analysis artifacts.
- AnalysisArtifactProvenance
- Provenance metadata for an analysis artifact.
- AnalysisAxisMeta
- Axis metadata for chart artifacts.
- AnalysisChartArtifact
- Artifact containing chart data with axes and multiple series.
- AnalysisColumnInfo
- Column metadata for an analysis source schema.
- AnalysisDataSet
- Data set returned from a source query.
- AnalysisDataSourcePort
- Contract for data source adapters.
- AnalysisError
- Error that occurred during analysis execution.
- AnalysisEvidenceLink
- Evidence link referencing source data for a summary artifact.
- AnalysisFunctionInfo
- Information about a registered analysis function.
- AnalysisFunctionPort
- Contract for pluggable analysis function registration and execution.
- AnalysisFunctionResult
- Result from executing an analysis function.
- AnalysisInputSource
- Definition of an analysis input source.
- AnalysisJob
- Represents a running or completed analysis job.
- AnalysisJobLog
- Log entry for an analysis job step execution.
- AnalysisMetricArtifact
- Artifact containing a single numeric metric value.
- AnalysisModelArtifact
- Artifact containing a trained or fitted model.
- AnalysisOutputDef
- Definition of an expected analysis output artifact.
- AnalysisParameterSchema
- Schema for a function parameter.
- AnalysisPort
- Abstract port for analysis operations.
- AnalysisSeriesArtifact
- Artifact containing time-series data points.
- AnalysisSourceSchema
- Schema describing the structure of an analysis input source.
- AnalysisSpec
- Complete analysis specification describing inputs, transforms, analysis steps, and expected outputs.
- AnalysisSpecMetadata
- Metadata associated with an analysis specification.
- AnalysisStep
- An individual analysis computation step.
- AnalysisSummaryArtifact
- Artifact containing a textual summary with evidence links.
- AnalysisTableArtifact
- Artifact containing tabular data.
- AnalysisTimePoint
- A time-indexed data point in a series.
- AnalysisTimeRange
- Time range for analysis input data.
- AnalysisTransform
- A data transformation step applied before analysis.
- AppliedIntervention
- Individual intervention applied during pipeline processing.
- AppraisalMetadata
- Metadata about the appraisal computation.
- AppraisalPort
- Port for appraisal operations over profile dimensions.
- AppraisalResult
- Complete result of appraisal metric computation.
- ApprovalDecision
- Individual approval decision.
- ApprovalEvent
- Event emitted when approval status changes.
- ApprovalPort
- Port for requesting and managing approvals.
- ApprovalRecord
- Historical approval record.
- ApprovalRequest
- Approval request details.
- ApprovalResult
- Result of an approval request.
- AsrOptions
- ASR processing options.
- AsrPort
- Port for ASR operations.
- AsrResult
- ASR transcription result.
- AsrSegment
- Single transcription segment.
- AssetContent
- Asset content.
- AssetPort
- Port for asset retrieval.
- AudienceConfig
- Configuration for audience adaptation.
- AudiencePreferences
- Audience preferences.
- AuditEvent
- Canonical audit event.
- AuditFilter
- Audit query filter.
- AuditPort
- Port for audit event recording.
- BinaryStoragePort
- Port for binary asset storage.
- Bound
- Numeric bound constraint for an argument value.
- BoundingBox
- Bounding box for visual elements.
- BundleDescriptor
- Bundle descriptor used by SkillRegistryPort.
- CandidateRecord
- Canonical candidate record.
- CandidatesPort
- Port for candidate fact operations.
- CapabilityDescriptor
- Descriptor for a device capability (action it can perform).
- ChannelAttachment
- Attachment in a channel event.
- ChannelCapabilities
- Capabilities of a channel implementation.
- ChannelDeliveryResult
- Delivery result for a specific channel.
- ChannelDescriptor
- Descriptor for a channel within a device (e.g., axis, joint, sensor).
- ChannelEvent
- Event received from a channel.
- ChannelIdentity
- Identifies a channel platform (e.g., 'slack', 'telegram', 'http', 'websocket').
- ChannelPort
- Abstract port for bidirectional channel communication.
- ChannelResponse
- Response to send to a channel.
- ChunkMeta
- Chunk metadata for multi-part payloads.
- Claim
- A verifiable assertion - the single canonical type for all packages.
- ClaimQuery
- Query descriptor for ClaimsPort.queryClaims.
- ClaimsPort
- Port for claim operations.
- ClaimValidationEntry
- Single-claim validation entry.
- ClaimValidationReport
- Aggregate validation report.
- CollectionStoragePort
- Abstract collection-based storage port.
- Command
- Command to execute on a device.
- CommandResult
- Result of a command execution.
- ConcurrencyDescriptor
- Describes concurrency constraints for an adapter.
- ConditionEvaluation
- Evaluation result for a single policy condition.
- Confidence
- Utility class for confidence calculations.
- ConfidenceThresholdConfig
- Configuration for confidence threshold behavior in appraisal.
- ContextBudget
- Budget constraints for a context bundle.
- ContextBundle
- Context bundle from FactGraph for skill execution.
- ContextBundlePort
- Port for context bundle construction.
- ContextBundleRequest
- Request for ContextBundlePort.buildContextBundle.
- ContextClaim
- Claim from context.
- ContextEntity
- Entity from context.
- ContextEvent
- Event from context.
- ContextView
- View/summary from context.
- ConversationKey
- Unique key for a conversation within a channel.
- DateRange
- Helper class for resolved date ranges.
- DecisionGuidance
- Guidance returned when a policy condition matches.
- DecisionModifier
- Additional modifier for a decision.
- DecisionPort
- Port for decision evaluation.
- DeviceDescriptor
- Full descriptor for an IO device.
- DeviceMatcher
- Rule for matching a device during auto-discovery.
- DirectionalAttitude
- Fundamental posture toward a domain.
- EchoChannelPort
- Echo channel port that echoes back messages.
- EmergencyStopRequest
- Request to perform an emergency stop.
- EmergencyStopResult
- Result of an emergency stop operation.
- EmptyLlmPort
- Empty LLM port that throws on use.
- EntitiesPort
- Port for entity operations in the fact graph.
- EntityQuery
- Query descriptor for EntitiesPort.queryEntities.
- EntityRecord
- Canonical entity record.
- EnvelopeMeta
- Envelope metadata including capture time and source address.
- Ethos
- Root philosophy definition containing all components.
- EthosMetadata
- Version, author, timestamps, context metadata for an Ethos.
- EthosRecord
- Canonical ethos record.
- EthosScope
- Domain-specific applicability scope for an Ethos.
- EthosStorePort
- Port for ethos storage.
- EventPort
- Event port for pub/sub.
- EvidenceFragment
- Evidence fragment.
- EvidencePort
- Port for evidence extraction operations.
- EvolutionProposal
- Proposed change to an Ethos based on feedback patterns.
- ExpressionPort
- Port for expression/template formatting operations.
- ExpressionStyle
- Complete expression style configuration.
- FactQuery
- Query descriptor for FactsPort.queryFacts.
- FactRecord
- Canonical fact record used by FactsPort.
- FactsPort
- Port for fact graph fact operations.
- FeedbackEvent
- Action result feedback for philosophy evolution.
- FormatConfig
- Configuration for response format.
- FormattedResponse
- Formatted response from expression processing.
- FormAutoFixAction
- An auto-fix action applied during validation.
- FormAxisConfig
- Axis configuration for a chart block.
- FormBlock
- Abstract base class for content blocks within a form document.
- FormCanvasBlock
- A live canvas scene embed.
- FormChartBlock
- A chart visualization block.
- FormConditionalBlock
- A conditional block that renders different content based on a condition.
- FormDataBinding
- A data binding that connects a form field to a data source.
- FormDocument
- A form document instance created from a template.
- FormDocumentMetadata
- Metadata associated with a form document.
- FormDocumentVersion
- A version entry in the document history.
- FormError
- Error details for form operations.
- FormFieldBlock
- An interactive form field block.
- FormFontPolicy
- Font policy configuration for form layout.
- FormHeadingBlock
- A heading content block with level.
- FormImageBlock
- An image content block.
- FormLayoutPolicy
- Layout policy for form document rendering.
- FormMargins
- Margin configuration for form layout.
- FormPageSize
- Page size configuration for form layout.
- FormPatchOperation
- A JSON Patch operation for updating a form document.
- FormPort
- Abstract port for form document operations.
- FormRendererMetadata
- Renderer metadata and capabilities.
- FormRendererPort
- Pluggable renderer for multi-format output.
- FormRenderMetrics
- Rendering performance metrics.
- FormRenderOutput
- Output from document rendering.
- FormRepeatableBlock
- A repeatable block that generates multiple instances from a template.
-
FormResult<
T> - Generic result wrapper for form operations.
- FormSchema
- Schema definition for form validation.
- FormSchemaField
- A field definition within a form schema.
- FormSchemaRule
- A validation rule within a form schema.
- FormSection
- A section within a form document.
- FormTableBlock
- A table content block with columns and rows.
- FormTableColumn
- Column definition for a table block.
- FormTableRow
- A row of data in a table block.
- FormTemplate
- Form template definition.
- FormTemplateDependency
- Template dependency entry.
- FormTemplateManifest
- Template manifest with dependencies and compatibility.
- FormTemplatePort
- Template storage, retrieval, and version management.
- FormTemplateVersion
- Template version history entry.
- FormTextBlock
- A plain text content block.
- FormValidationIssue
- A validation issue found during document validation.
- FormValidationResult
- Result of a form document validation.
- GrammarConfig
- Grammar configuration.
- HedgingConfig
- Configuration for hedging language.
- HedgingPhrases
- Custom hedging phrases.
- IndexBuildConfig
- Index build configuration.
- IndexPort
- Port for knowledge index management.
- IngestPorts
- Bundle of all ingest-related ports.
- InMemoryBinaryStoragePort
- In-memory binary storage for testing.
- InMemoryCollectionStoragePort
- In-memory collection storage for testing.
- InMemoryEventPort
- In-memory event port for testing.
- InMemoryKvStoragePort
- In-memory KV storage for testing.
-
InMemoryStoragePort<
T> - In-memory typed storage for testing.
- Interlock
- Interlock that must be satisfied before an action proceeds.
- InterventionResult
- Result of a pipeline intervention.
- IoAuditExportConfig
- Configuration for exporting audit records to an external system.
- IoAuditPort
- Port for recording and querying IO device audit trails.
- IoAuditQuery
- Filter criteria for querying audit records.
- IoAuditRecord
- Immutable record of an auditable IO operation.
- IoDevicePort
- Abstract port for IO device communication.
- IoError
- Error information from an IO operation.
- IoPolicyPort
- Port for managing and querying I/O policy rules.
- IoRegistryPort
- Abstract port for device and adapter registry operations.
- IoStreamPort
- Abstract port for streaming subscriptions to I/O device topics.
- IoStreamSubscription
- Active subscription with its associated data stream.
- JudgmentCriterion
- Conditional decision rule with preferred action.
- KvStoragePort
- Key-value storage port.
- LanguageConfig
- Configuration for language and localization.
- LlmCapabilities
- LLM capabilities configuration.
- LlmChunk
- Streaming chunk.
- LlmMessage
- LLM message for multi-turn conversations.
- LlmPort
- Abstract LLM Port interface.
- LlmRequest
- LLM request.
- LlmResponse
- LLM response.
- LlmTool
- Tool definition for function calling.
- LlmToolCall
- Tool call from LLM.
- LlmUsage
- Token usage information.
- MatchedCriterion
- Matched judgment criterion result.
- McpPort
- Port for Model Context Protocol operations.
- MetricEvent
- Metric event for streaming.
- MetricPort
- Metric computation port.
- MetricResult
- Result for a single computed metric.
- MetricSpec
- Specification for on-demand metric computation.
- MetricsPort
- Port for evaluation metric operations.
- MetricValue
- Metric value.
- MultiLayerContext
- Multi-layer context for tension detection.
- Notification
- Notification to send.
- NotificationPort
- Port for sending notifications.
- NotificationRecord
- Historical notification record.
- NotificationResult
- Result of sending a notification.
- OcrOptions
- OCR processing options.
- OcrPort
- Port for OCR operations.
- OcrRegion
- OCR region with position.
- OcrResult
- OCR recognition result.
- PassagePosition
- Position of passage in source document.
- PatternQuery
- Query descriptor for PatternsPort.queryPatterns.
- PatternRecord
- Canonical pattern record.
- PatternsPort
- Port for pattern operations.
- PayloadEnvelope
- Envelope wrapping a typed payload with URI and metadata.
- PayloadSource
- Source information for a typed payload.
- Period
- Base class for Period types.
- PhilosophyEvaluationContext
- Context for philosophy evaluation.
- PhilosophyGuidance
- Result of evaluating an Ethos against a context.
- PhilosophyPort
- Abstract port interface for Philosophy operations.
- PipelineContext
- Pipeline data for intervention.
- PipelinePort
- Port for pipeline execution.
- PipelineRunHandle
- Pipeline run handle.
- PolicyCondition
- Condition that determines when a policy rule applies.
- PolicyConstraints
- Constraints applied when a policy rule allows an action.
- PolicyDecision
- Result of evaluating a policy against an action.
- PolicyRule
- A single policy rule governing I/O actions.
- PolicyTrace
- Trace of policy evaluation for a command.
- PortEvent
- Event data.
- ProfileSummariesPort
- Port for profile summary retrieval.
- ProfileSummaryResult
- Evaluation-level profile summary result.
- Prohibition
- Absolute boundary with severity classification.
- ProhibitionCheck
- Individual prohibition check result.
- ProhibitionCheckRequest
- Request to check prohibitions.
- ProhibitionCheckResult
- Result of prohibition checks.
- ProhibitionException
- Exception condition for a prohibition.
- PromptTemplate
- MCP prompt template.
- ProposedChange
- Specific change details for an evolution proposal.
- QueryFilter
- Query filter for collection storage.
- RateLimit
- Rate limit constraint for action invocations.
- ReadOptions
- Options for a read operation.
- ReadResult
- Result of a read operation.
- ReadResultItem
- Single item in a read result.
- ReadSpec
- Specification for a read operation.
- ReadTiming
- Timing information for a read operation.
- RegistryEvent
- Event emitted by the registry when device or adapter state changes.
- RelativePeriod
- Relative period - a duration from reference time.
- ResolutionOption
- Available resolution option for a tension.
- ResourceContent
- Resource content read from an MCP server.
- ResourceDescriptor
- Descriptor for a resource exposed by a channel.
- ResourceInfo
- Resource information.
- RetrievalPort
- Port for knowledge retrieval operations.
- RetrievalResult
- Retrieval result.
- RetrievedPassage
- Retrieved passage.
- RetrieverInfo
- Retriever information.
- RunbookDescriptor
- Runbook descriptor.
- RunbookExecution
- Result of a runbook execution.
- RunbookPort
- Port for runbook execution.
- RunQuery
- Query descriptor for RunsPort.queryRuns.
- RunRecord
- Canonical run record.
- RunsPort
- Port for run record operations.
- ScheduleTarget
- Target for a scheduled/triggered action.
- ScheduleTriggerPort
- Port for scheduled and event-based triggers.
- SkillRegistryPort
- Port for skill bundle registry.
- SkillRunHandle
- Handle for an executing or completed skill run.
- SkillRuntimePort
- Port for skill execution.
- SourceInfo
- Describes where a piece of evidence came from.
- StateWeighting
- Dynamic adjustment factors for philosophy execution intensity.
- StateWeightingImpact
- Audit record of how state modified philosophy output.
- StorageMetadata
- Storage metadata.
- StorageOptions
- Storage options.
-
StoragePort<
T> - Generic storage port for typed entities.
- StubAnalysisDataSourcePort
- Stub data source port for testing.
- StubAnalysisFunctionPort
- Stub function port for testing.
- StubAnalysisPort
- Stub implementation of AnalysisPort for testing.
- StubAppraisalPort
- Stub appraisal port for testing.
- StubApprovalPort
- Stub implementation for testing.
- StubAsrPort
- Stub ASR port for testing.
- StubAssetPort
- Stub implementation for testing.
- StubAuditPort
- Stub implementation for testing.
- StubCandidatesPort
- Stub implementation for testing.
- StubChannelPort
- Stub channel port for testing.
- StubClaimsPort
- Stub implementation for testing.
- StubContextBundlePort
- Stub implementation for testing.
- StubDecisionPort
- Stub decision port for testing.
- StubEntitiesPort
- Stub implementation for testing.
- StubEthosStorePort
- Stub implementation for testing.
- StubEvidencePort
- Stub evidence port for testing.
- StubExpressionPort
- Stub expression port for testing.
- StubFactsPort
- Stub implementation for testing.
- StubFormPort
- Stub form port for testing.
- StubFormRendererPort
- Stub renderer for testing.
- StubFormTemplatePort
- Stub template port for testing.
- StubIndexPort
- Stub implementation for testing.
- StubIoAuditPort
- In-memory stub for testing audit operations.
- StubIoDevicePort
- Stub implementation of IoDevicePort for testing.
- StubIoPolicyPort
- Stub implementation of IoPolicyPort for testing.
- StubIoRegistryPort
- Stub implementation of IoRegistryPort for testing.
- StubIoStreamPort
- Stub implementation of IoStreamPort for testing.
- StubLlmPort
- Stub LLM port for testing.
- StubMcpPort
- Stub MCP port for testing.
- StubMetricPort
- Stub metric port for testing.
- StubMetricsPort
- Stub implementation for testing.
- StubNotificationPort
- Stub implementation for testing.
- StubOcrPort
- Stub OCR port for testing.
- StubPatternsPort
- Stub implementation for testing.
- StubPhilosophyPort
- Stub philosophy port for testing.
- StubPipelinePort
- Stub implementation for testing.
- StubProfileSummariesPort
- Stub implementation for testing.
- StubRetrievalPort
- Stub implementation for testing.
- StubRunbookPort
- Stub implementation for testing.
- StubRunsPort
- Stub implementation for testing.
- StubScheduleTriggerPort
- Stub implementation for testing.
- StubSkillRegistryPort
- Stub implementation for testing.
- StubSkillRuntimePort
- Stub implementation for testing.
- StubSummariesPort
- Stub implementation for testing.
- StubUiPort
- Stub implementation of UiPort for testing.
- StubVisionPort
- Stub Vision port for testing.
- StubWorkflowPort
- Stub implementation for testing.
- SubscriptionHandle
- Handle identifying an active subscription.
- SubscriptionStatus
- Status information for an active subscription.
- SummariesPort
- Port for summary operations.
- SummaryRecord
- Canonical summary record.
- Tension
- Detected tension between Philosophy and another layer.
- TensionResolution
- Resolution of a detected tension.
- TensionSource
- Source of a tension (which layers are in conflict).
- ToneConfig
- Configuration for communication tone.
- ToolInfo
- Tool information.
- ToolResult
- Tool execution result.
- TopicOptions
- Options for a topic subscription.
- TopicSpec
- Specification for a topic subscription.
- TransportDescriptor
- Describes a transport type and its default configuration.
- TypedPayload
- Typed payload with value, unit, timestamp, and quality.
- UiError
- Structured error for UiPort operations.
- UiPort
- Abstract port for bidirectional UI definition ↔ bundle transformation.
-
UiResult<
T> - Result wrapper for UiPort operations.
- UiWriteOutput
- Output of the write operation (UiPort.fromDefinition).
- ValuePriority
- Ordered principle for value conflict resolution.
- ValueResolution
- Value conflict resolution result.
- VisionFace
- Vision face detection.
- VisionLabel
- Vision label/object.
- VisionOptions
- Vision processing options.
- VisionPort
- Port for vision analysis operations.
- VisionResult
- Vision analysis result.
- VocabularyConfig
- Vocabulary configuration.
- WorkflowDescriptor
- Workflow descriptor.
- WorkflowPort
- Port for workflow execution.
- WorkflowRunHandle
- Workflow run handle.
Enums
- AnalysisAlertSeverity
- Severity level for analysis alerts.
- AnalysisArtifactType
- Type of analysis artifact produced.
- AnalysisExecutionMode
- Execution mode for an analysis job.
- AnalysisJobStatus
- Status of an analysis job.
- AnalysisSourceType
- Source type for analysis input data.
- ApprovalDecisionType
- Type of decision made by an approver.
- ApprovalEventType
- Type of approval event.
- ApprovalPolicy
- Approval policy determines how approvals are collected.
- ApprovalPriority
- Priority of approval request.
- ApprovalStatus
- Status of an approval request.
- AttitudeDomain
- Domain of attitude applicability.
- AudienceContext
- Audience context.
- BackpressurePolicy
- Backpressure handling policy for subscriptions.
- CandidateStatus
- Candidate lifecycle states.
- ClaimStatus
- Verification state of the claim.
- ClaimType
- Semantic type of the claim content.
- CommandStatus
- Status of a command execution.
- ConfidenceLevel
- Semantic ranges for confidence interpretation.
- Decision
- Policy decision outcome.
- DecisionAction
- Actions that can be recommended by a decision policy.
- Directness
- Directness levels.
- Empathy
- Empathy levels.
- EvolutionType
- Type of evolution.
- Expertise
- Expertise levels.
- FeedbackOutcome
- Outcome classification for feedback.
- Formality
- Formality levels.
- FormBlockType
- Type of content block within a form document.
- FormDataSourceType
- Source type for form data bindings.
- FormDocumentStatus
- Status of a form document in its lifecycle.
- HedgingLevel
- Hedging levels.
- HedgingPosition
- Hedging position.
- InterlockAction
- Action to take when an interlock condition is met.
- InterlockCondition
- Condition operator for interlock rules.
- InterventionPoint
- Pipeline stage for philosophy intervention.
- InterventionType
- Types of pipeline intervention.
- IoAuditType
- Type of auditable IO operation.
- IoConnectionState
- Connection state of an IO device.
- JargonLevel
- Jargon levels.
- Length
- Response length types.
- MetricSourceType
- Source type for metric computation.
- ModifierType
- Types of decision modifiers.
- NotificationChannel
- Channel for notification delivery.
- NotificationPriority
- Priority of notification.
- NotificationStatus
- Status of a notification.
- NotificationType
- Type of notification.
- PayloadKind
- Kind of payload carried in an envelope.
- PayloadType
- Data type of a typed payload value.
- PeriodDirection
- Direction of relative period from reference time.
- PeriodUnit
- Period unit for relative periods.
- ProhibitionSeverity
- Severity of a prohibition: hard = blocking, soft = warning.
- ProposalStatus
- Status of an evolution proposal.
- Quality
- Quality indicator for a payload value.
- RegistryEventType
- Type of registry lifecycle event.
- ResolutionStrategy
- Strategy for resolving a tension.
- RunStatus
- Run lifecycle status.
- SafetyClass
- Safety classification for a device capability.
- SentenceComplexity
- Sentence complexity.
- Structure
- Response structure types.
- TensionLayer
- Which layer is involved in a tension.
- TensionSeverity
- Severity of a tension.
- ToneConfidence
- Tone confidence levels.
- TopicMode
- Subscription topic delivery mode.
- TransportType
- Transport protocol type for device communication.
- VisualPreference
- Visual preference.
- VoicePreference
- Voice preference.
Extensions
Exceptions / Errors
- AssetNotFoundException
- Exception when asset is not found.
- RetrieverNotFoundException
- Exception when retriever is not found.