@hyperscale0/adl 1.0.248 → 1.0.251

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.
package/README.md CHANGED
@@ -10,9 +10,12 @@
10
10
 
11
11
  # ADL
12
12
 
13
+ Read [how Hyperscale fits](https://hyperscale0.ai/docs/runtime.md#how-hyperscale-fits) for provider authority and the shared operation API.
14
+
13
15
  ADL declares provider bindings and the instruction and observation contract for external work. HSX authors money behavior; UDL carries that contract into execution. The runtime owns money accounts, reservations and evidence consumption.
14
16
 
15
- ADL is the translation layer between Hyperscale and the providers underneath it. The provider originates the loan, policy, account or payout and carries its risk; an adapter maps that provider's real lifecycle and schema onto one canonical shape and reports its evidence. Hyperscale never originates anything, so a shape that no real provider exposes does not belong in ADL.
17
+ An adapter maps a real provider's lifecycle and schema onto a canonical shape and
18
+ returns its evidence. Shapes follow real provider contracts.
16
19
 
17
20
  ## Install
18
21
 
@@ -0,0 +1,59 @@
1
+ import * as z from "zod";
2
+ import { createProviderAdapterRegistry } from "@hyperscale0/adl";
3
+
4
+ /** Quote and issuance only. The insurer supplies every commercial decision. */
5
+ export interface InsurancePolicyVocabulary {
6
+ readonly capability: "insurance_policy";
7
+ readonly obligation: "insurance_quote" | "insurance_policy";
8
+ readonly operation:
9
+ | "insurance.quote"
10
+ | "insurance.bind"
11
+ | "insurance.policy.observe";
12
+ readonly resource: "insurance_quote" | "insurance_policy";
13
+ }
14
+
15
+ export const insurancePolicyAdapter =
16
+ createProviderAdapterRegistry<InsurancePolicyVocabulary>()([
17
+ {
18
+ provider: "conformance_insurance",
19
+ capability: "insurance_policy",
20
+ bindings: { insurance_quote: "strict", insurance_policy: "strict" },
21
+ operationMap: {
22
+ "insurance.quote": {
23
+ operation: "insurance.quote",
24
+ direction: "tenant_initiated",
25
+ obligationKind: "insurance_quote",
26
+ resourceKind: "insurance_quote",
27
+ resourceIdPath: "quoteId",
28
+ },
29
+ "insurance.bind": {
30
+ operation: "insurance.bind",
31
+ direction: "tenant_initiated",
32
+ obligationKind: "insurance_policy",
33
+ resourceKind: "insurance_policy",
34
+ resourceIdPath: "policyId",
35
+ },
36
+ "insurance.policy.observe": {
37
+ operation: "insurance.policy.observe",
38
+ direction: "system_settlement",
39
+ obligationKind: "insurance_policy",
40
+ resourceKind: "insurance_policy",
41
+ resourceIdPath: "policyId",
42
+ },
43
+ },
44
+ },
45
+ ])[0];
46
+
47
+ /** Minimal normalized issuance evidence, not a rating or underwriting schema. */
48
+ export function insurancePolicyIssuanceSchema(quoteId: string) {
49
+ return z.strictObject({
50
+ provider: z.literal(insurancePolicyAdapter.provider),
51
+ policyId: z.string().min(1),
52
+ quoteId: z.literal(quoteId),
53
+ insurerId: z.string().min(1),
54
+ state: z.literal("issued"),
55
+ issuedAt: z.iso.datetime(),
56
+ effectiveFrom: z.iso.datetime(),
57
+ effectiveTo: z.iso.datetime(),
58
+ });
59
+ }
@@ -1,11 +1,21 @@
1
1
  # Writing a provider adapter in ADL
2
2
 
3
+ Read [how Hyperscale fits](https://hyperscale0.ai/docs/runtime.md#how-hyperscale-fits) for provider authority and the shared operation API.
4
+
3
5
  `ProviderAdapter` declares an adapter's identity, operation bindings and subject
4
6
  requirements. `BoundaryAdapter` implements dispatch and observation. The runtime
5
7
  owns instruction identity and money accounts.
6
8
 
7
9
  ## Declare the binding
8
10
 
11
+ For a domain example, see
12
+ [`conformance/insurance-policy-adapter.ts`](../conformance/insurance-policy-adapter.ts).
13
+ It uses a custom vocabulary for quote, bind and policy observation. A completed
14
+ bind identifies the downstream insurer's issued policy and must correlate with
15
+ the bound quote. An accepted request without issuance evidence remains pending.
16
+ The fixture does not rate a policy, collect premium or register a live engine
17
+ adapter.
18
+
9
19
  Use `createProviderAdapterRegistry` to validate declarations. Each operation map
10
20
  key must equal its binding's `operation`. Its `resourceKind` must appear in
11
21
  `bindings`. Subject requirements describe required authored fields or attachments;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperscale0/adl",
3
- "version": "1.0.248",
3
+ "version": "1.0.251",
4
4
  "description": "The Adapter Declaration Language: generic evidence, provider declarations and conformance.",
5
5
  "keywords": [
6
6
  "adl",
@@ -63,7 +63,7 @@
63
63
  "typecheck": "tsc -p tsconfig.json"
64
64
  },
65
65
  "dependencies": {
66
- "@hyperscale0/udl": "1.0.248",
66
+ "@hyperscale0/udl": "1.0.251",
67
67
  "zod": "4.6.5"
68
68
  },
69
69
  "devDependencies": {
@@ -76,5 +76,5 @@
76
76
  "Amir Ayub",
77
77
  "Sara AlBakaawi"
78
78
  ],
79
- "gitHead": "4c62dd1d7e0f2d210a66e0c5e899f02e84987029"
79
+ "gitHead": "82a83298f59fbc5ac14bbe837173ed735bdb491c"
80
80
  }