@intentic/need-resolver
v1.326.0
Published
Defines the intent data the SDK records and derives from it the abstract capabilities the deployment needs, before any concrete tool is chosen.
Readme
need-resolver
Defines the intent data the SDK records and derives from it the abstract capabilities the deployment needs, before any concrete tool is chosen.
flowchart LR
sdk["sdk<br/>i.have · i.want"] -- "IntentSet" --> need(["need-resolver<br/>resolveNeeds"])
need -- "Need[]<br/>capability · scope · plane" --> state["state-resolver<br/>catalog picks an option"]- A
Needis one capability at one scope:source-control,docker-registryandinfra-controlon the control-plane host,deployment-targeton every host that runs something, anddomainon the Cloudflare account. - Many apps collapse into one set of needs. The control-plane host is the first declared host with apps (
controlPlaneHostId). - It validates the intent as a whole: apps without Cloudflare, targets on undeclared hosts and workspace tools naming undeclared services all throw here.
- The intent stays plain data. Handles become resource-id strings, so an
IntentSetserializes and carries no SDK types.
Key files
- src/intent.ts —
IntentSetand one intent type per declaration kind. - src/inputs.ts — the author-supplied input shapes (
HostInput,EnvironmentInput,UpdatePolicy). - src/needs.ts —
resolveNeeds,Capability,Planeand the control-plane host rule. - src/needs.test.ts — which intents produce which needs, by example.
Commands
pnpm --filter @intentic/need-resolver test