flutter_agent_harness 0.1.47 copy "flutter_agent_harness: ^0.1.47" to clipboard
flutter_agent_harness: ^0.1.47 copied to clipboard

Cross-platform AI agent harness for Dart and Flutter: streaming provider adapters, agent loop with tools, session persistence, context compaction.

example/example.dart

import 'package:flutter_agent_harness/flutter_agent_harness.dart';

/// Minimal example: cooperative cancellation with [CancelToken].
Future<void> main() async {
  final source = CancelTokenSource();

  // Simulate a long-running operation that honors cancellation.
  final worker = () async {
    for (var i = 0; i < 100; i++) {
      await Future<void>.delayed(const Duration(milliseconds: 50));
      source.token.throwIfCancelled();
      print('tick $i');
    }
  }();

  // Cancel after 200ms.
  Future<void>.delayed(const Duration(milliseconds: 200), source.cancel);

  try {
    await worker;
  } on CancelledException {
    print('worker cancelled');
  }
}
1
likes
0
points
583
downloads

Publisher

unverified uploader

Weekly Downloads

Cross-platform AI agent harness for Dart and Flutter: streaming provider adapters, agent loop with tools, session persistence, context compaction.

Repository (GitHub)
View/report issues

Topics

#agent #llm #ai #streaming #flutter

License

unknown (license)

Dependencies

archive, dart_tui, http, image, meta, mime, sqlite3, yaml

More

Packages that depend on flutter_agent_harness