intentcall_codegen 0.6.0 copy "intentcall_codegen: ^0.6.0" to clipboard
intentcall_codegen: ^0.6.0 copied to clipboard

PRE-RELEASE — Optional @AgentTool annotations and build_runner codegen for intentcall.

⚠️ Pre-release train — Highly experimental. APIs may change without notice. Not for production. Details.

intentcall_codegen #

pub package pub points repository

Optional @AgentTool / @AgentParam annotations and build_runner codegen pilot.

Hand-written AgentCallEntry remains first-class; codegen is opt-in for stable tools with typed parameters.

Pilot usage #

  1. Add dependencies from the current hosted train:
dart pub add intentcall_core intentcall_schema intentcall_codegen
dart pub add --dev build_runner
  1. Annotate a top-level function:
import 'package:intentcall_codegen/intentcall_codegen.dart';
import 'package:intentcall_core/intentcall_core.dart';
import 'package:intentcall_schema/intentcall_schema.dart';

part 'my_tools.g.dart';

@AgentTool(namespace: 'app', name: 'demo_ping', description: 'Ping')
Future<AgentResult> demoPing(@AgentParam('Message') String message) async {
  return AgentResult.success(data: {'pong': message});
}
  1. Run codegen:
dart run build_runner build --delete-conflicting-outputs
  1. Register generated intent:
registry.register(demoPingRegistration);
// or
registerAll(registry, {demoPingCallEntry});

Generated output #

For each @AgentTool function, .g.dart emits:

  • _<name>InputSchema — JSON Schema from parameter types
  • <name>CallEntryAgentCallEntry.tool(...) factory
  • <name>RegistrationRegisteredAgentIntent via .toRegistration()

Supported parameter types: String, int, bool, double.

Scope (pilot) #

  • Top-level functions only
  • Tool kind only (resources: hand-write AgentCallEntry.resource)
  • Test fixture: test/fixtures/demo_ping_tool.dart

See DX FAQ for current codegen workflow and Design FAQ for the IntentPack direction.

0
likes
140
points
545
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

PRE-RELEASE — Optional @AgentTool annotations and build_runner codegen for intentcall.

Repository (GitHub)
View/report issues
Contributing

Topics

#mcp #codegen #build-runner

License

MIT (license)

Dependencies

analyzer, build, intentcall_core, intentcall_schema, meta, source_gen

More

Packages that depend on intentcall_codegen