uyava_protocol 0.2.1-beta.1 copy "uyava_protocol: ^0.2.1-beta.1" to clipboard
uyava_protocol: ^0.2.1-beta.1 copied to clipboard

Shared Uyava wire-protocol constants and minimal types (pure Dart).

Uyava Protocol #

uyava_protocol is a pure Dart package with shared wire-level contracts for Uyava SDK/hosts. It contains canonical event type names, payload models, normalization helpers, validation helpers, and session-file contract types for .uyava record/replay logs.

What is in this package #

  • Canonical event/type enums:
    • UyavaEventTypes
    • UyavaSeverity
    • UyavaLifecycleState
    • filter/metric enums (UyavaFilter*, UyavaMetricAggregator)
  • Wire payload models:
    • graph: UyavaGraphNodePayload, UyavaGraphEdgePayload
    • runtime events: UyavaGraphNodeEventPayload, UyavaGraphEdgeEventPayload
    • diagnostics: UyavaGraphDiagnosticPayload
    • metrics/chains/filters: UyavaMetricDefinitionPayload, UyavaMetricSamplePayload, UyavaEventChainDefinitionPayload, UyavaGraphFilterCommandPayload
    • replay wrapper: UyavaReplayEnvelopePayload
  • Session archive contract (.uyava): UyavaSessionHeader, UyavaSessionEventRecord, UyavaSessionMarkerRecord, UyavaSessionControlRecord, UyavaSessionFormatAdapter
  • Data normalization and validation helpers used across SDK/hosts.

Usage #

import 'package:uyava_protocol/uyava_protocol.dart';

void main() {
  final nodeResult = UyavaGraphNodePayload.sanitize({
    'id': 'auth.service',
    'type': 'service',
    'label': 'Auth Service',
    'tags': ['Auth', 'backend'],
    'color': '#ff00aa',
    'shape': 'hexagon',
  });

  final edgeResult = UyavaGraphEdgePayload.sanitize({
    'id': 'auth.service->auth.repo',
    'source': 'auth.service',
    'target': 'auth.repo',
  });

  if (!nodeResult.isValid || !edgeResult.isValid) {
    throw StateError('Invalid graph payload');
  }

  final header = UyavaSessionHeader(
    sessionId: 'sess-001',
    startedAt: DateTime.now().toUtc(),
    appName: 'Uyava Example',
    appVersion: '0.2.0',
  );

  final parsed = UyavaSessionFormatAdapter().parseHeader(
    Map<String, dynamic>.from(header.toJson()),
  );
  assert(parsed.sessionId == 'sess-001');
}

Notes #

  • This package is intentionally Flutter-free and UI-agnostic.
  • Snapshot edge fields are canonicalized as source / target.
  • publish_to: none means the package is currently workspace-internal.

License #

MIT — see LICENSE.

0
likes
140
points
110
downloads

Documentation

Documentation
API reference

Publisher

verified publisheruyava.io

Weekly Downloads

Shared Uyava wire-protocol constants and minimal types (pure Dart).

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

freezed_annotation, json_annotation

More

Packages that depend on uyava_protocol