resolvePackage method

  1. @override
Future<Package> resolvePackage(
  1. String reference
)
override

Resolves a package from an id or a bare name.

Everything user-facing — the CLI's --package omnyagent, the API's /packages/{id} — accepts either, because requiring an opaque id for the common single-tenant case would make the tool unusable by hand.

Throws PackageNotFoundException if nothing matches, or ValidationException if a bare name is ambiguous across projects — an ambiguous reference must never be resolved by picking one arbitrarily.

Implementation

@override
Future<Package> resolvePackage(String reference) async => Package.fromJson(
  await _result(StoreProtocol.packageResolve, {'reference': reference}),
);