patchbay_flutter_host library
Patchbay 的 Flutter host 入口(PB-060-02 / DG-060-02)。
组合根用它:core 的 host 清单(默认 consumer 面加 host lifecycle)、
patchbay_flutter 的全部自有符号(PatchbayFlutterServiceHost、
PatchbayFlutterBridge、inspector / navigation / gesture / semantics / reveal /
capture / keep-awake bridge 与它们的 policy),以及这些 bridge 的公共签名真正需要的那
一小组 wire 与 wait 类型。
它是 package:patchbay_flutter/patchbay_flutter.dart 的严格超集,所以 main.dart
这类装配文件只写这一个 import 即可;widget 文件继续只 import 默认面,让「这个文件能不能
碰 host」在 import 行上一眼可读。
需要完整 protocol 面(全部 71 个 *Wire、digest、permission companion)时再显式加
package:patchbay/patchbay_protocol.dart;本 library 只按自足闭包带上它用得到的那几个,
也不存在 patchbay_flutter_protocol.dart。
Classes
- PatchbayArtifactService
- Explicitly injected log/blob command module shared by core and Flutter.
- PatchbayAuditDrainResult
- Immutable accounting for the audit events accepted before the drain gate.
- PatchbayAuditEvent
- One redacted command audit fact retained by PatchbayServiceHost.
- PatchbayAuditExecutionDetails
- Host-only, additive projection of confirmed execution facts for one accepted command. PB-050-26 / DG-060-04.
- PatchbayAuditRevealExecutionDetails
-
stepsand the driven container node ids for one acceptedui.revealcall. PB-050-26 / DG-060-04. - PatchbayBlobChunkWire
-
Strict wire representation of
PatchbayBlobChunkWire. - PatchbayBlobMetadataWire
-
Strict wire representation of
PatchbayBlobMetadataWire. - PatchbayCancellationSignal
- PatchbayCaptureBridge
- Captures only Flutter-composited repaint boundaries and stores PNG bytes in the shared bounded blob store.
- PatchbayCaptureDiffRequestWire
-
Strict wire representation of
PatchbayCaptureDiffRequestWire. - PatchbayCaptureRequestWire
-
Strict wire representation of
PatchbayCaptureRequestWire. - PatchbayCatalogProvider
- A catalog source with an explicit, cheap commands invalidation signal.
- PatchbayCatalogSample
- A complete catalog observation bound to the commands revision it describes.
- PatchbayCliEqualsCondition
- PatchbayCliSyntax
- One CLI spelling derived from a protocol-owned command descriptor.
- PatchbayCommandDescriptor
- Consumer-neutral catalog entry. Business namespaces remain consumer-owned.
-
PatchbayCommandRegistration<
T> - One indivisible protocol-owned command registration.
- PatchbayCommandRegistry
- Transport-neutral catalog and dispatch table for protocol-owned commands.
- PatchbayDecodedCapture
- PatchbayDestinationDescriptor
- Runtime catalog row for one consumer-owned destination.
- PatchbayDestinationDescriptorWire
-
Strict wire representation of
PatchbayDestinationDescriptorWire. - PatchbayEncodedCapture
- PatchbayExecutionContract
-
Descriptor-owned policy used to interpret a payload's
executionobject. - PatchbayExecutionValidationResult
- PatchbayFlutterBridge
- Executes cataloged UI operators after base and descriptor gates.
- PatchbayFlutterServiceHost
- Registers the Flutter UI catalog and operators on the generic host.
- PatchbayFrameObserver
- Counts only frames explicitly observed by Patchbay operations.
- PatchbayGateDecision
- Stable decision returned by the host base gate or a consumer gate.
- PatchbayGateEvaluator
- Runs the non-optional host gate before descriptor-declared consumer gates.
- PatchbayGateRejection
- PatchbayGestureBridge
- Identifier-anchored synthetic pointer gestures for debug builds.
- PatchbayGestureDecision
- Consumer decision and optional tighter budgets for one gesture.
- PatchbayGestureTarget
- Read-only target facts supplied to the independent gesture policy.
- PatchbayHostInvocationHandle
- A response may freeze before the underlying invocation lifecycle releases.
- PatchbayInspectBridge
- Turns the on-device widget inspector's select mode on, off, or reports it.
- PatchbayInspectorSurface
- The Flutter-SDK side of the switch, isolated so it can be faked in tests.
- PatchbayInspectPolicy
- Consumer opt-in for the widget inspector select-mode switch.
- PatchbayInspectSelectRequestWire
-
Strict wire representation of
PatchbayInspectSelectRequestWire. - PatchbayInvocation
- Admission envelope. It deliberately does not claim domain execution.
- PatchbayInvocationCancellationResult
- Immutable control-plane answer. It never includes the owner token.
- PatchbayInvocationCancellationSignal
- Read-only cancellation signal exposed to a context-aware consumer.
- PatchbayInvocationContext
- Additive per-invocation context for cooperative consumers.
- PatchbayInvocationDeadline
- A host-local deadline view. It never exposes wall-clock time.
- PatchbayInvocationDrainResult
- Frozen terminal accounting for invocations present when drain began.
- PatchbayJobEvent
- PatchbayJobRegistry
- In-isolate job ledger for operations whose completion cannot be represented honestly by the admission response.
- PatchbayJobSnapshot
- PatchbayJobWaitResult
- PatchbayKeepAwakeBridge
- Opt-in "keep the screen awake" switch with a framework-owned lease.
- PatchbayKeepAwakeRequestWire
-
Strict wire representation of
PatchbayKeepAwakeRequestWire. - PatchbayKey
- A target key whose GlobalKey semantics stay identical in every build mode.
- PatchbayLogPage
- Consumer-owned query result. Patchbay applies its own response bounds after the source returns and never subscribes to or takes ownership of the source.
- PatchbayLogQuery
- PatchbayLogRecordWire
-
Strict wire representation of
PatchbayLogRecordWire. - PatchbayLogSource
- Consumer injection seam for already-redacted structured records.
- PatchbayMemoryBlobStore
- Bounded, process-local storage for binary artifacts.
- The single navigation adapter injected at the consumer composition root.
- Serial, revision-fenced destination navigation with UI observation.
- Consumer-owned mapping from a stable destination ID to existing routing.
- A consumer-observed, settled navigation state.
- PatchbayOutputArtifactProjection
-
The
artifacthalf of a declaration: at most one artifact per command. - PatchbayOutputBriefProjection
-
The
briefhalf of a declaration: a stable id plus a deny-list. - PatchbayOutputProjection
- One command's whole machine-output declaration.
- PatchbayOutputProjectionPath
-
A parsed restricted path:
$followed by one or more.field, where any non-final field may carry[]to traverse the maps of a list. - PatchbayOutputProjectionPathSegment
-
One
.field(optionally[]) step of a restricted projection path. - PatchbayParameterDescriptor
- Machine-readable argument declaration used by both validation and CLI help.
- PatchbayRedactedLogRecord
- A log record whose public constructor enforces Patchbay's defensive redaction boundary before a consumer source can return it.
- PatchbayRejection
- Stable rejection attached only when a request was not admitted.
- PatchbayResponseSchema
- Accepted and job-terminal payload declarations for one command.
- PatchbayResponseValidationIssue
- One value-free validation issue safe to return to an untrusted caller.
- PatchbayResponseValueSchema
- One recursively declared response value.
- PatchbayRetryPolicy
- Bounded retry contract for one consumer-owned external command.
- PatchbayRevealBridge
- identifier 锚定的 scroll-to-reveal,debug 构建可用。
- PatchbayRevealDecision
- 接入方对驱动一个滚动容器的决定,外加可收紧的预算。
- PatchbayRoot
- Optional composition-root wrapper. In release this is exactly its child; in other modes it adds only a repaint boundary and no layout/state widget.
- PatchbayRootController
- PatchbaySemanticsActionDecision
- Consumer-owned decision for one currently observed semantics action.
- PatchbaySemanticsBridge
- Public-API Flutter Semantics observer and action dispatcher.
- PatchbaySemanticsEntry
- PatchbaySemanticsIdentifierMatch
- One currently attached node selected by a stable Semantics identifier.
- PatchbaySemanticsIdentifierObservation
- Current result of resolving a Semantics identifier.
- PatchbaySemanticsTarget
- Read-only target facts supplied to the consumer action policy.
- PatchbayServiceHost
- Generic VM Service extension host. It has no Flutter or consumer imports.
- PatchbaySnapshotRetentionLimits
- The three budgets a host applies to snapshot revision retention.
- PatchbaySnapshotSample
- One snapshot observation bound to the content revision the App reports.
- PatchbayUiRegistry
- Weak target registry. Consumers create Keys, not registration lifecycles.
- PatchbayUiTargetDeclaration
-
Consumer declaration stored by a
PatchbayKeywithout Widget callbacks. - PatchbayUiTargetDescriptor
- Runtime catalog entry. Operations are the declaration/runtime intersection.
- PatchbayUiWaitBridge
- Bounded Flutter observer for stable Semantics, navigation, and revisions.
- PatchbayUiWaitRequest
- Validated, consumer-neutral request for one bounded Flutter observation.
- PatchbayUiWaitRequestWire
-
Strict wire representation of
PatchbayUiWaitRequestWire.
Enums
- PatchbayAdmission
- PatchbayAuditDrainOutcome
- The terminal outcome of one host audit-delivery drain.
- PatchbayBlobFailureCode
- PatchbayBlobSourceWire
-
Strict wire representation of
PatchbayBlobSourceWire. - PatchbayCliArtifactDisposition
- PatchbayCliInputMode
- PatchbayCommandMode
- PatchbayExecutionClassification
- PatchbayFactSource
- Closed vocabulary for the strength and origin of a Patchbay fact.
- PatchbayFactSourceWire
-
Strict wire representation of
PatchbayFactSourceWire. - PatchbayFeature
- A protocol capability a host declares on the identity plane.
- PatchbayGestureKind
- Pointer gesture families supported by the anchored gesture bridge.
-
Strict wire representation of
PatchbayInspectUnavailableWire. - PatchbayInteractionModel
- Closed catalog-wire classification distinguishing an explicit consumer automation surface from an action that must still satisfy user-like reachability (DG-060-05, "交互模型进入 catalog").
- PatchbayInvocationCancellationOutcome
- Stable result of the protocol-owned cancel operation.
- PatchbayInvocationCancellationReason
- The first transport or host fact that asked one invocation to stop.
- PatchbayInvocationConfirmationState
- Why a requested cancellation was not confirmed inside its observation budget.
- PatchbayInvocationDrainOutcome
- PatchbayJobCancelOutcome
- What a cancellation attempt actually achieved for one job.
- PatchbayJobPhase
- PatchbayJobWaitOutcome
- PatchbayLogDirectionWire
-
Strict wire representation of
PatchbayLogDirectionWire. - PatchbayLogLevelWire
-
Strict wire representation of
PatchbayLogLevelWire. - PatchbayLogPageState
- PatchbayLogRedactionWire
-
Strict wire representation of
PatchbayLogRedactionWire. - Stable navigation verbs exposed without leaking a consumer route path.
-
Strict wire representation of
PatchbayNavigationOperationWire. - PatchbayOutputArtifactEncoding
- How a PatchbayOutputArtifactKind.renderedMember member becomes bytes.
- PatchbayOutputArtifactKind
- Where an artifact's bytes come from. A closed set: a declaration may not name a path, a template, a formatter or a second artifact.
- PatchbayParameterType
- PatchbayPlane
- PatchbayResponseType
- Closed JSON value kinds supported by command response schemas.
- PatchbayRevealDirection
- 一次 reveal 请求的内容序方向。
- PatchbayRevealDirectionWire
-
Strict wire representation of
PatchbayRevealDirectionWire. - PatchbaySemanticsAction
- Stable Patchbay names for the first supported Flutter semantics actions.
- PatchbaySensitivePolicy
- PatchbaySideEffect
- PatchbayUiOperation
- PatchbayUiTargetKind
- PatchbayUiWaitCondition
- PatchbayUiWaitConditionWire
-
Strict wire representation of
PatchbayUiWaitConditionWire.
Constants
-
patchbayAuditAdmissionStages
→ const Set<
String> - The stage an invocation's admission pipeline stopped or completed at.
-
patchbayAuditExecutionDetailsDefectReasons
→ const Set<
String> - Closed reasons PatchbayAuditExecutionDetailsProjectionDefect reports.
-
patchbayAuditGateDispositions
→ const Set<
String> - How the invocation stood relative to consumer declared gates and dynamic operation policy.
- patchbayAuditLegacyUnknown → const String
- What a new audit reader must assume when an old host omits the new keys.
- patchbayConfirmationBudgetMaxMs → const int
- patchbayOutputProjectionJsonExtension → const String
- File extension paired with PatchbayOutputArtifactEncoding.json.
- patchbayOutputProjectionJsonMediaType → const String
- Media type paired with PatchbayOutputArtifactEncoding.json.
- patchbayOutputProjectionMaxIdLength → const int
- Maximum length of a brief projection id.
- patchbayOutputProjectionMaxOmitRules → const int
-
Maximum number of
omitrules one brief declaration may carry. - patchbayOutputProjectionMaxPathBytes → const int
- Maximum bytes one restricted path literal may occupy.
- patchbayOutputProjectionReservedRootPrefix → const String
- Root-level prefix the CLI reserves for the facts it appends itself.
- patchbayOutputProjectionTextExtension → const String
- File extension paired with PatchbayOutputArtifactEncoding.utf8Text.
- patchbayOutputProjectionTextMediaType → const String
- Media type paired with PatchbayOutputArtifactEncoding.utf8Text.
- patchbayPackageVersion → const String
-
The
patchbaypackage version the host was compiled from. - patchbayResponseSchemaMaxDepth → const int
- patchbayResponseSchemaMaxFields → const int
- patchbayResponseValidationMaxIssues → const int
- patchbaySnapshotDefaultMaxRetainedBytes → const int
- Default total retained canonical UTF-8 budget (DG-050-01).
- patchbaySnapshotDefaultMaxSnapshotBytes → const int
- Default per-snapshot canonical UTF-8 budget (DG-050-01).
- patchbaySnapshotDiffMaxChanges → const int
- Maximum number of path changes returned by one diff.
- patchbaySnapshotDiffMaxEncodedBytes → const int
- Maximum encoded bytes returned by one diff.
- patchbaySnapshotMinSnapshotBytes → const int
- Smallest per-snapshot canonical UTF-8 budget a host may be configured with.
- patchbaySnapshotPollInterval → const Duration
- How often the host re-reads the consumer snapshot while waiting.
- patchbaySnapshotRetainedByteCeiling → const int
- Largest total retained canonical UTF-8 budget a host may be configured with.
- patchbaySnapshotRevisionRetention → const int
- Revisions retained per App instance for bounded snapshot diffing.
- patchbaySnapshotRevisionRetentionCeiling → const int
- Largest retained-revision count a host may be configured with.
- patchbaySnapshotSnapshotByteCeiling → const int
- Largest per-snapshot canonical UTF-8 budget a host may be configured with.
- patchbaySnapshotWaitCeiling → const Duration
-
Longest wait the host will accept, matching the
ui.waitfamily. - patchbayUnchangedEvidenceMaxAgeMs → const int
Functions
-
patchbayAuditExecutionClassification(
Map< String, Object?> response) → String? - The stable execution classification projected by both host audit and CLI trace consumers from one invocation response.
-
patchbayGenerateOwnerToken(
) → String -
patchbayProjectAuditEvent(
{required String command, required String requestId, required Map< String, Object?> arguments, required String gateResult, required Map<String, Object?> response, String? admissionStage, String? gateDisposition, PatchbayAuditExecutionDetailsDefectHandler? onExecutionDetailsDefect}) → PatchbayAuditEvent - Builds the redacted audit projection from a command fact.
-
validatePatchbayExecutionContract(
PatchbayExecutionContract contract) → void -
validatePatchbayExecutionEvidence(
PatchbayExecutionContract contract, Object? payload, {String path = r'$.payload', String? terminalPhase, required int nowMs}) → PatchbayExecutionValidationResult -
validatePatchbayResponsePayload(
PatchbayResponseValueSchema schema, Object? payload, {String path = r'$.payload'}) → List< PatchbayResponseValidationIssue> -
validatePatchbayResponseSchema(
PatchbayResponseSchema schema) → void -
validatePatchbayTerminalPayload(
PatchbayResponseSchema schema, Object? payload) → List< PatchbayResponseValidationIssue> - Validates the terminal event carried by a completed job-wait payload.
Typedefs
- PatchbayAuditExecutionDetailsDefectHandler = void Function(String reason)
-
Signature for patchbayProjectAuditEvent's
onExecutionDetailsDefectcallback: fired with one of patchbayAuditExecutionDetailsDefectReasons when a recognisably reveal-shaped accepted response violates a closed DG-060-04 bound. The projected event always omitsexecutionDetailsin that case regardless of whether a callback is supplied. -
PatchbayAuditSink
= FutureOr<
void> Function(PatchbayAuditEvent event) - PatchbayAuditSinkErrorHandler = void Function(Object error, StackTrace stackTrace, PatchbayAuditEvent event)
-
PatchbayBaseGate
= FutureOr<
PatchbayGateDecision> Function() -
PatchbayCancellationConfirmation
= Future<
void> Function(PatchbayInvocationCancellationReason reason) - Consumer proof that cancellation has stopped the underlying operation.
-
PatchbayCaptureDecoder
= Future<
PatchbayDecodedCapture> Function(Uint8List bytes) -
PatchbayCaptureEncoder
= Future<
PatchbayEncodedCapture> Function(RenderRepaintBoundary boundary, double pixelRatio) -
PatchbayCatalogSource
= Future<
Map< Function()String, Object?> > -
PatchbayCommandDecoder<
T> = T Function(Map< String, Object?> arguments) -
PatchbayCommandFailureHandler
= Map<
String, Object?> Function(Object failure, Map<String, Object?> arguments, String requestId, PatchbayCommandDescriptor descriptor) -
PatchbayCommandGate<
T> = FutureOr< Map< Function(T request, String requestId)String, Object?> ?> -
PatchbayCommandHandler<
T> = FutureOr< Map< Function(T request, String requestId)String, Object?> > -
PatchbayConsumerGate
= FutureOr<
PatchbayGateDecision> Function(String gateId) -
PatchbayContextCommandHandler<
T> = FutureOr< Map< Function(T request, String requestId, PatchbayInvocationContext context)String, Object?> > -
PatchbayContextInvocationSource
= Future<
Map< Function(String command, Map<String, Object?> >String, Object?> arguments, String requestId, PatchbayInvocationContext context) - PatchbayExtensionRegistrar = void Function(String method, ServiceExtensionHandler handler)
-
PatchbayGestureDelay
= Future<
void> Function(Duration duration) - PatchbayGesturePolicy = PatchbayGestureDecision Function(PatchbayGestureTarget target, PatchbayGestureKind gesture)
-
PatchbayInvocationSource
= Future<
Map< Function(String command, Map<String, Object?> >String, Object?> arguments, String requestId) -
PatchbayJobBody
= Future<
Map< Function()String, Object?> > -
PatchbayJobCancellation
= FutureOr<
void> Function() - Confirms that the underlying operation has stopped after cancellation.
-
PatchbayKeepAwakeDelegate
= FutureOr<
void> Function(bool enabled) - The consumer-owned hook that actually holds the screen awake.
- PatchbayLifecycleStateReader = AppLifecycleState? Function()
-
Reads the App lifecycle state a
*LifecycleNotResumedrejection reports. - PatchbayMonotonicClock = Duration Function()
- Host-local monotonic time source used by invocation deadlines.
- PatchbayPointerEventDispatcher = void Function(PointerEvent event)
- PatchbayRevealPolicy = PatchbayRevealDecision Function(PatchbaySemanticsTarget container, PatchbayRevealDirection direction)
- 接入方对「允不允许把这块区域往内容深处推」的判断。
- PatchbaySemanticsActionPolicy = PatchbaySemanticsActionDecision Function(PatchbaySemanticsTarget target, PatchbaySemanticsAction action)
-
PatchbaySnapshotSource
= Future<
Map< Function()String, Object?> > -
PatchbayVersionedSnapshotSource
= Future<
PatchbaySnapshotSample> Function() - A snapshot source with an explicit, cheap content invalidation signal.
Exceptions / Errors
- PatchbayAuditDeliveryClosed
- Reports a ledger event recorded after audit delivery was closed.
- PatchbayAuditDeliveryOverflow
- Reports one complete burst of audit events dropped by bounded delivery.
- PatchbayAuditExecutionDetailsProjectionDefect
-
Reports that an accepted
ui.revealresponse could not be safely projected into PatchbayAuditEvent.executionDetails. - PatchbayBlobFailure
- PatchbayJobCancellationSignal
- A consumer-observed domain cancellation whose payload is already redacted.
- PatchbayJobCapacityExceeded
- Thrown synchronously when a registry has reached its running-job budget.
- PatchbayJobFailure
- A consumer-observed domain failure whose payload is already redacted.
- PatchbayLogRecordTooLarge
- PatchbayLogRedactionFailure
- PatchbayLogSourceContractFailure