pub fn phase_workers_provider_agent_cross_context(
target: BuildTarget,
parsed: &[ParsedFile],
groups: &BTreeMap<String, Vec<usize>>,
kinds: &BTreeMap<String, UnitKind>,
unit_tables: &HashMap<String, UnitTable>,
unit_consumes: &HashMap<String, Vec<String>>,
unit_consumes_aliases: &HashMap<String, HashMap<String, String>>,
unit_flattened: &HashMap<String, HashMap<String, String>>,
errors: &mut ErrorSink,
)Expand description
#2355 follow-up: on the Workers target, a context may not require a
capability whose provider, in another context, constructs that context’s
agents. The consumer’s composition root builds the provider in-process and
hands it the consumer’s own env, which binds only the consumer’s Durable
Object namespaces: tsc rejects the build, and strip-only bynk dev
quietly falls back to agent state held in the isolate. The capability can
be reached through any given the consumer’s compose instantiates — a
service or agent handler’s, or a local provider’s, transitively — so the
walk is collect_given_closure’s, reported once per provider at the
first given that reaches it. On the bundle target the whole program
shares one process and the agent factory takes only the key, so the check
is Workers-only, like phase_workers_unprovided_capabilities.