@intentic/need-resolver 1.310.0 → 1.311.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +19 -17
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,25 +1,27 @@
1
- # @intentic/need-resolver
1
+ # need-resolver
2
2
 
3
- The **need resolver**: turns an authored `IntentSet` into the abstract capabilities it requires. It owns the authored intent shapes and the intent → needs derivation, the first stage of the pipeline. Depends only on [`@intentic/graph`](../graph); consumed by [`@intentic/state-resolver`](../state-resolver) and [`@intentic/sdk`](../sdk).
3
+ Defines the intent data the SDK records and derives from it the abstract capabilities the deployment needs, before any concrete tool is chosen.
4
4
 
5
- ## Responsibilities
5
+ ```mermaid
6
+ flowchart LR
7
+ sdk["sdk<br/>i.have · i.want"] -- "IntentSet" --> need(["need-resolver<br/>resolveNeeds"])
8
+ need -- "Need[]<br/>capability · scope · plane" --> state["state-resolver<br/>catalog picks an option"]
9
+ ```
6
10
 
7
- - Define the authored intent shapes (`IntentSet`, `HostIntent`, `CloudflareIntent`, `AppIntent`, …) and their input types.
8
- - Derive the abstract `Need`s an intent implies (`source-control`, `docker-registry`, `infra-control`, `deployment-target`, `domain`) each a `Capability` on a `Plane` (control vs application).
9
- - It stops at *abstract capabilities*: it does **not** choose concrete options (Forgejo/Komodo/etc.) or emit graph nodes, that is `state-resolver`'s job.
11
+ - A `Need` is one capability at one scope: `source-control`, `docker-registry` and `infra-control` on the control-plane host, `deployment-target` on every host that runs something, and `domain` on the Cloudflare account.
12
+ - Many apps collapse into one set of needs. The control-plane host is the first declared host with apps (`controlPlaneHostId`).
13
+ - It validates the intent as a whole: apps without Cloudflare, targets on undeclared hosts and workspace tools naming undeclared services all throw here.
14
+ - The intent stays plain data. Handles become resource-id strings, so an `IntentSet` serializes and carries no SDK types.
10
15
 
11
16
  ## Key files
12
17
 
13
- - [src/intent.ts](src/intent.ts): the authored intent types (`IntentSet` and friends).
14
- - [src/inputs.ts](src/inputs.ts): input shapes (`HostInput`, `CloudflareInput`, `EnvironmentInput`, `NotifyInput`, …).
15
- - [src/needs.ts](src/needs.ts): `resolveNeeds`, `Capability`/`Need`/`Plane`, `needKey`.
16
- - [src/index.ts](src/index.ts): public surface.
18
+ - [src/intent.ts](src/intent.ts) — `IntentSet` and one intent type per declaration kind.
19
+ - [src/inputs.ts](src/inputs.ts) — the author-supplied input shapes (`HostInput`, `EnvironmentInput`, `UpdatePolicy`).
20
+ - [src/needs.ts](src/needs.ts) — `resolveNeeds`, `Capability`, `Plane` and the control-plane host rule.
21
+ - [src/needs.test.ts](src/needs.test.ts) — which intents produce which needs, by example.
17
22
 
18
- ## How it fits
23
+ ## Commands
19
24
 
20
- Stage 1 of intent → needs → desired-state. The `sdk` builds an `IntentSet` from a `deploy.config.ts`; `resolveNeeds` turns it into `Need`s; `state-resolver` assigns each need a catalog option and emits nodes.
21
-
22
- ## Conventions & gotchas
23
-
24
- - Needs are intentionally provider-agnostic: keep concrete tech names out of this layer.
25
- - Each need carries its `Plane`; downstream resolution and ordering rely on it. Co-located tests in [src/needs.test.ts](src/needs.test.ts). See [ARCHITECTURE.md](../../ARCHITECTURE.md).
25
+ ```sh
26
+ pnpm --filter @intentic/need-resolver test
27
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentic/need-resolver",
3
- "version": "1.310.0",
3
+ "version": "1.311.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,7 +30,7 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@intentic/graph": "1.310.0",
33
+ "@intentic/graph": "1.311.0",
34
34
  "tslib": "2.8.1"
35
35
  },
36
36
  "devDependencies": {