@aventara/core 1.0.0-rc.3 → 1.0.0-rc.8

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 (96) hide show
  1. package/CHANGELOG.md +231 -1
  2. package/ERRORS.md +6 -6
  3. package/README.md +76 -12
  4. package/dist/adapters/adapter-field.d.ts +8 -0
  5. package/dist/adapters/adapter-identifier.d.ts +9 -0
  6. package/dist/adapters/adapter-identifier.js +6 -1
  7. package/dist/adapters/adapter-operation.d.ts +13 -0
  8. package/dist/compiler/contract.compiler.d.ts +6 -0
  9. package/dist/compiler/contract.compiler.js +99 -15
  10. package/dist/config/computed-fields.js +2 -9
  11. package/dist/config/config-diagnostic.guidance.js +3 -3
  12. package/dist/config/config.resolver.d.ts +14 -0
  13. package/dist/config/config.resolver.js +31 -0
  14. package/dist/config/config.validator.js +82 -0
  15. package/dist/config/exact-framework-config.d.ts +5 -0
  16. package/dist/config/framework-config.d.ts +30 -1
  17. package/dist/contracts/client-contract-structure.validator.d.ts +8 -0
  18. package/dist/contracts/client-contract-structure.validator.js +6 -1
  19. package/dist/contracts/contract.d.ts +15 -1
  20. package/dist/contracts/field.d.ts +28 -0
  21. package/dist/contracts/scalar-value-type.d.ts +3 -1
  22. package/dist/framework/contract-view.d.ts +41 -10
  23. package/dist/framework/framework-construction.error.d.ts +2 -1
  24. package/dist/framework/framework-construction.error.js +11 -1
  25. package/dist/framework/framework.d.ts +4 -4
  26. package/dist/framework/framework.factory.js +39 -11
  27. package/dist/framework/operation-facade.d.ts +29 -10
  28. package/dist/framework/operation-facade.js +2 -1
  29. package/dist/index.d.ts +10 -4
  30. package/dist/internal.d.ts +2 -2
  31. package/dist/internal.js +2 -0
  32. package/dist/operations/operation-arguments.d.ts +44 -28
  33. package/dist/operations/operation-call.d.ts +9 -5
  34. package/dist/operations/operation-result.d.ts +6 -4
  35. package/dist/operations/operation-validator-core.js +6 -0
  36. package/dist/policy/policy-admission.d.ts +22 -0
  37. package/dist/policy/policy-admission.js +409 -0
  38. package/dist/policy/policy-after-update.runtime.d.ts +29 -0
  39. package/dist/policy/policy-after-update.runtime.js +132 -0
  40. package/dist/policy/policy-condition.d.ts +15 -0
  41. package/dist/policy/policy-condition.js +36 -0
  42. package/dist/policy/policy-engine.d.ts +118 -0
  43. package/dist/policy/policy-engine.js +1 -0
  44. package/dist/policy/policy-nested-write.runtime.d.ts +38 -0
  45. package/dist/policy/policy-nested-write.runtime.js +453 -0
  46. package/dist/policy/policy-read.runtime.d.ts +81 -0
  47. package/dist/policy/policy-read.runtime.js +503 -0
  48. package/dist/policy/policy-request.d.ts +41 -0
  49. package/dist/policy/policy-request.js +63 -0
  50. package/dist/policy/policy-session.d.ts +93 -0
  51. package/dist/policy/policy-session.js +235 -0
  52. package/dist/policy/policy-startup.validator.d.ts +8 -0
  53. package/dist/policy/policy-startup.validator.js +104 -0
  54. package/dist/policy/policy-write.runtime.d.ts +37 -0
  55. package/dist/policy/policy-write.runtime.js +409 -0
  56. package/dist/prebuilt/core-version.generated.d.ts +2 -0
  57. package/dist/prebuilt/core-version.generated.js +1 -0
  58. package/dist/prebuilt/prebuilt-changes.d.ts +28 -0
  59. package/dist/prebuilt/prebuilt-changes.js +65 -0
  60. package/dist/prebuilt/prebuilt-contracts.d.ts +40 -0
  61. package/dist/prebuilt/prebuilt-contracts.emitter.d.ts +16 -0
  62. package/dist/prebuilt/prebuilt-contracts.emitter.js +50 -0
  63. package/dist/prebuilt/prebuilt-contracts.js +1 -0
  64. package/dist/prebuilt/prebuilt-contracts.loader.d.ts +21 -0
  65. package/dist/prebuilt/prebuilt-contracts.loader.js +77 -0
  66. package/dist/prebuilt/prebuilt-inputs.fingerprint.d.ts +16 -0
  67. package/dist/prebuilt/prebuilt-inputs.fingerprint.js +192 -0
  68. package/dist/protocol/absent-route.responder.d.ts +4 -4
  69. package/dist/protocol/http-request.decoder.d.ts +2 -2
  70. package/dist/protocol/http-request.reader.d.ts +2 -2
  71. package/dist/protocol/protocol-headers.d.ts +3 -3
  72. package/dist/runtime/computed-read-runtime.d.ts +6 -1
  73. package/dist/runtime/computed-read-runtime.js +226 -52
  74. package/dist/runtime/context-executor.runtime.d.ts +2 -2
  75. package/dist/runtime/context-executor.runtime.js +4 -2
  76. package/dist/runtime/create-requirement.js +1 -1
  77. package/dist/runtime/diagnostics-reporter.d.ts +5 -5
  78. package/dist/runtime/execution-options.d.ts +8 -0
  79. package/dist/runtime/framework-warning.emitter.d.ts +6 -0
  80. package/dist/runtime/framework-warning.emitter.js +8 -0
  81. package/dist/runtime/level-lifecycle.runtime.js +3 -2
  82. package/dist/runtime/operation-code.guidance.js +3 -3
  83. package/dist/runtime/operation-request.d.ts +16 -9
  84. package/dist/runtime/operation-runtime.d.ts +15 -7
  85. package/dist/runtime/operation-runtime.js +139 -14
  86. package/dist/runtime/owned-execution.registry.d.ts +2 -2
  87. package/dist/runtime/readonly-value.d.ts +5 -1
  88. package/dist/runtime/readonly-value.js +67 -28
  89. package/dist/runtime/referential-action.d.ts +1 -1
  90. package/dist/transactions/sql-statement.d.ts +2 -2
  91. package/dist/transactions/transaction-plan-assembler.d.ts +2 -2
  92. package/dist/transactions/transaction-plan-validator.d.ts +5 -5
  93. package/dist/transactions/transaction-request.d.ts +8 -8
  94. package/dist/transactions/transaction-runtime.d.ts +5 -2
  95. package/dist/transactions/transaction-runtime.js +33 -6
  96. package/package.json +2 -2
@@ -0,0 +1,77 @@
1
+ import { bindPrebuiltContracts, } from "../compiler/contract.compiler.js";
2
+ import { recordCanonicalContractText } from "../contracts/contract-canonicalizer.js";
3
+ import { AVENTARA_PROTOCOL_VERSION } from "../contracts/contract-protocol.js";
4
+ import { emitFrameworkWarning } from "../runtime/framework-warning.emitter.js";
5
+ import { CORE_VERSION } from "./core-version.generated.js";
6
+ import { listedNames, prebuiltHeaderChanges, prebuiltInputChanges, } from "./prebuilt-changes.js";
7
+ import { PREBUILT_FORMAT } from "./prebuilt-contracts.js";
8
+ import { prebuiltInputsFingerprint, prebuiltPartFingerprints, } from "./prebuilt-inputs.fingerprint.js";
9
+ export const PREBUILT_STALE_WARNING = "AVENTARA_PREBUILT_STALE";
10
+ function isRecord(value) {
11
+ return value !== null && typeof value === "object" && !Array.isArray(value);
12
+ }
13
+ async function changedInputs(stored, model, config) {
14
+ const changes = prebuiltInputChanges(stored, await prebuiltPartFingerprints(model, config));
15
+ return changes.length === 0
16
+ ? "its fingerprint does not match the configuration and model"
17
+ : `${listedNames(changes)} since it was built`;
18
+ }
19
+ function textAt(record, key) {
20
+ const value = Object.hasOwn(record, key) ? record[key] : undefined;
21
+ return typeof value === "string" ? value : undefined;
22
+ }
23
+ function parsedContracts(texts) {
24
+ if (!isRecord(texts)) {
25
+ return undefined;
26
+ }
27
+ const parsed = {};
28
+ for (const origin of ["core", "application", "client", "agent"]) {
29
+ const text = textAt(texts, origin);
30
+ if (text === undefined) {
31
+ return undefined;
32
+ }
33
+ let contract;
34
+ try {
35
+ contract = JSON.parse(text);
36
+ }
37
+ catch {
38
+ return undefined;
39
+ }
40
+ if (!isRecord(contract)) {
41
+ return undefined;
42
+ }
43
+ parsed[origin] = contract;
44
+ }
45
+ const contracts = parsed;
46
+ recordCanonicalContractText(contracts.client, textAt(texts, "client") ?? "");
47
+ recordCanonicalContractText(contracts.agent, textAt(texts, "agent") ?? "");
48
+ return contracts;
49
+ }
50
+ export async function loadPrebuiltContracts(prebuilt, model, config, resolved) {
51
+ if (!isRecord(prebuilt)) {
52
+ return { ok: false, reason: "it is not a prebuilt Contracts file" };
53
+ }
54
+ const [header] = prebuiltHeaderChanges(prebuilt, {
55
+ format: PREBUILT_FORMAT,
56
+ core: CORE_VERSION,
57
+ protocol: AVENTARA_PROTOCOL_VERSION,
58
+ });
59
+ if (header !== undefined) {
60
+ return { ok: false, reason: header };
61
+ }
62
+ if ((await prebuiltInputsFingerprint(model, config)) !== prebuilt.fingerprint) {
63
+ return {
64
+ ok: false,
65
+ reason: await changedInputs(prebuilt.fingerprints, model, config),
66
+ };
67
+ }
68
+ const contracts = parsedContracts(prebuilt.contracts);
69
+ if (contracts === undefined) {
70
+ return { ok: false, reason: "its Contracts are not readable JSON objects" };
71
+ }
72
+ bindPrebuiltContracts(model, resolved, contracts);
73
+ return { ok: true, contracts };
74
+ }
75
+ export function warnStalePrebuilt(reason) {
76
+ emitFrameworkWarning(`prebuilt Contracts are stale and were not used: ${reason}. The Contracts were compiled at startup instead; regenerate the file with aventara-build.`, PREBUILT_STALE_WARNING);
77
+ }
@@ -0,0 +1,16 @@
1
+ import type { AvAdapterModel } from "../adapters/adapter-model.js";
2
+ /**
3
+ * The fingerprint of the inputs Contracts are compiled from: `config` as
4
+ * authored (its `adapter` and `prebuilt` left out), `model`, this core's
5
+ * version, the protocol version and the file format.
6
+ */
7
+ export declare function prebuiltInputsFingerprint(model: AvAdapterModel, config: object): Promise<string>;
8
+ /** The inputs' parts, each fingerprinted on its own: what a file stores to name what changed. */
9
+ export type PrebuiltPartFingerprints = {
10
+ /** The inputs that belong to no single Resource. */
11
+ readonly shared: string;
12
+ /** Each Resource's inputs (its model, and its entries in every layer), by name, sorted. */
13
+ readonly resources: Readonly<Record<string, string>>;
14
+ };
15
+ /** The parts of the same inputs as {@link prebuiltInputsFingerprint}'s, each fingerprinted. */
16
+ export declare function prebuiltPartFingerprints(model: AvAdapterModel, config: object): Promise<PrebuiltPartFingerprints>;
@@ -0,0 +1,192 @@
1
+ import { avzCheckOf } from "../avz/avz-check.registry.js";
2
+ import { jsonShapeOf } from "../avz/json-shape.registry.js";
3
+ import { hashCanonicalContractText } from "../contracts/contract-hash.js";
4
+ import { AVENTARA_PROTOCOL_VERSION } from "../contracts/contract-protocol.js";
5
+ import { CORE_VERSION } from "./core-version.generated.js";
6
+ import { PREBUILT_FORMAT } from "./prebuilt-contracts.js";
7
+ const LAYERS = ["root", "application", "client", "agent"];
8
+ const NOT_INPUTS = new Set(["adapter", "prebuilt"]);
9
+ const PER_RESOURCE = "#resources";
10
+ function isRecord(value) {
11
+ return value !== null && typeof value === "object" && !Array.isArray(value);
12
+ }
13
+ function sortedRecord(record) {
14
+ const keys = Object.keys(record);
15
+ const prototype = Object.getPrototypeOf(record);
16
+ const plain = prototype === Object.prototype || prototype === null;
17
+ let written = plain;
18
+ for (let index = 0; written && index < keys.length; index += 1) {
19
+ const key = keys[index];
20
+ written =
21
+ !key.startsWith("#") &&
22
+ (index === 0 || keys[index - 1] < key);
23
+ }
24
+ if (written) {
25
+ return record;
26
+ }
27
+ const sorted = {};
28
+ if (!plain) {
29
+ const name = record.constructor?.name;
30
+ sorted["#class"] = typeof name === "string" ? name : "";
31
+ }
32
+ for (const key of keys.sort()) {
33
+ sorted[key.startsWith("#") ? `#${key}` : key] = record[key];
34
+ }
35
+ return sorted;
36
+ }
37
+ function inputMember(key, value) {
38
+ const raw = this[key];
39
+ switch (typeof raw) {
40
+ case "string":
41
+ return raw.startsWith("#") ? `#${raw}` : raw;
42
+ case "number":
43
+ return Number.isFinite(raw) ? raw : `#number(${raw})`;
44
+ case "bigint":
45
+ return `#bigint(${raw})`;
46
+ case "function":
47
+ return "#function";
48
+ case "symbol":
49
+ return `#symbol(${String(raw.description)})`;
50
+ case "undefined":
51
+ return "#undefined";
52
+ case "boolean":
53
+ return raw;
54
+ }
55
+ if (raw === null) {
56
+ return value;
57
+ }
58
+ const check = avzCheckOf(raw);
59
+ if (check !== undefined) {
60
+ return `#avz(${inputText(check)})`;
61
+ }
62
+ const shape = jsonShapeOf(raw);
63
+ if (shape !== undefined) {
64
+ return `#shape(${inputText(shape.schema)})`;
65
+ }
66
+ if (raw instanceof Date) {
67
+ return `#date(${Number.isNaN(raw.getTime()) ? "invalid" : raw.toISOString()})`;
68
+ }
69
+ if (raw instanceof RegExp) {
70
+ return `#regexp(${JSON.stringify(raw.source)},${raw.flags})`;
71
+ }
72
+ if (raw instanceof Map || raw instanceof Set) {
73
+ return `#${raw instanceof Map ? "map" : "set"}(${inputText([...raw])})`;
74
+ }
75
+ if (value !== raw) {
76
+ return `#json(${inputText(value)})`;
77
+ }
78
+ return Array.isArray(raw) ? raw : sortedRecord(raw);
79
+ }
80
+ function inputText(value) {
81
+ return JSON.stringify(value, inputMember);
82
+ }
83
+ function modelText(value) {
84
+ try {
85
+ return JSON.stringify(value) ?? "#undefined";
86
+ }
87
+ catch {
88
+ return inputText(value);
89
+ }
90
+ }
91
+ function recordAt(value, key) {
92
+ if (!isRecord(value) || !Object.hasOwn(value, key)) {
93
+ return undefined;
94
+ }
95
+ const member = value[key];
96
+ return isRecord(member) ? member : undefined;
97
+ }
98
+ function layerOf(config, layer) {
99
+ return layer === "root"
100
+ ? config
101
+ : Object.hasOwn(config, layer)
102
+ ? config[layer]
103
+ : undefined;
104
+ }
105
+ function sharedLayer(layer) {
106
+ if (!isRecord(layer)) {
107
+ return layer;
108
+ }
109
+ const shared = { ...layer };
110
+ if (isRecord(layer.resources)) {
111
+ shared.resources = PER_RESOURCE;
112
+ }
113
+ const exemptions = layer.exemptions;
114
+ if (isRecord(exemptions) && isRecord(exemptions.resources)) {
115
+ shared.exemptions = { ...exemptions, resources: PER_RESOURCE };
116
+ }
117
+ return shared;
118
+ }
119
+ function policyInput(policy) {
120
+ if (!isRecord(policy) || !Object.hasOwn(policy, "engine")) {
121
+ return policy;
122
+ }
123
+ const engine = policy.engine;
124
+ const governed = engine !== null && typeof engine === "object"
125
+ ? engine.governed
126
+ : undefined;
127
+ return { ...policy, engine: { governed: governed ?? null } };
128
+ }
129
+ function authoredInputs(config) {
130
+ const authored = config;
131
+ const root = {};
132
+ for (const key of Object.keys(authored)) {
133
+ if (!NOT_INPUTS.has(key)) {
134
+ root[key] = key === "policy" ? policyInput(authored[key]) : authored[key];
135
+ }
136
+ }
137
+ return root;
138
+ }
139
+ const HEADER = `aventara-prebuilt format ${PREBUILT_FORMAT} core ${CORE_VERSION} protocol ${AVENTARA_PROTOCOL_VERSION}`;
140
+ export function prebuiltInputsFingerprint(model, config) {
141
+ return hashCanonicalContractText(`${HEADER}\n${inputText(authoredInputs(config))}\n${modelText(model)}`);
142
+ }
143
+ export async function prebuiltPartFingerprints(model, config) {
144
+ const root = authoredInputs(config);
145
+ const names = new Set(Object.keys(model.resources));
146
+ for (const layer of LAYERS) {
147
+ const value = layerOf(root, layer);
148
+ for (const name of Object.keys(recordAt(value, "resources") ?? {})) {
149
+ names.add(name);
150
+ }
151
+ const exemptions = recordAt(value, "exemptions");
152
+ for (const name of Object.keys(recordAt(exemptions, "resources") ?? {})) {
153
+ names.add(name);
154
+ }
155
+ }
156
+ const sharedRoot = sharedLayer(root);
157
+ for (const layer of LAYERS) {
158
+ if (layer !== "root" && Object.hasOwn(root, layer)) {
159
+ sharedRoot[layer] = sharedLayer(root[layer]);
160
+ }
161
+ }
162
+ const { resources: _resources, ...sharedModel } = model;
163
+ const shared = hashCanonicalContractText(`${HEADER}\n${inputText(sharedRoot)}\n${modelText(sharedModel)}`);
164
+ const sorted = [...names].sort();
165
+ const parts = sorted.map((name) => {
166
+ const entries = {};
167
+ for (const layer of LAYERS) {
168
+ const value = layerOf(root, layer);
169
+ const resources = recordAt(value, "resources");
170
+ const exemptions = recordAt(recordAt(value, "exemptions"), "resources");
171
+ const entry = {};
172
+ if (resources !== undefined && Object.hasOwn(resources, name)) {
173
+ entry.resources = resources[name];
174
+ }
175
+ if (exemptions !== undefined && Object.hasOwn(exemptions, name)) {
176
+ entry.exemptions = exemptions[name];
177
+ }
178
+ if (Object.keys(entry).length > 0) {
179
+ entries[layer] = entry;
180
+ }
181
+ }
182
+ const modelPart = Object.hasOwn(model.resources, name)
183
+ ? modelText(model.resources[name])
184
+ : "#absent";
185
+ return hashCanonicalContractText(`${inputText(entries)}\n${modelPart}`);
186
+ });
187
+ const hashes = await Promise.all(parts);
188
+ return {
189
+ shared: await shared,
190
+ resources: Object.fromEntries(sorted.map((name, index) => [name, hashes[index]])),
191
+ };
192
+ }
@@ -2,7 +2,7 @@ import type { AvContracts } from "../compiler/contract.compiler.js";
2
2
  import type { RemoteRequestOrigin } from "../config/config-layer.js";
3
3
  import { type AvOperationIdentity } from "../operations/operation-identity.js";
4
4
  import { type AvDiagnosticsSink } from "../runtime/diagnostics-reporter.js";
5
- import type { ClientProtocolIdentity } from "../runtime/operation-request.js";
5
+ import type { AvRequestProtocol } from "../runtime/operation-request.js";
6
6
  import { type AvOperationFailureResponse } from "../runtime/operation-response.js";
7
7
  import type { AvProtocolRequest } from "./http-request.decoder.js";
8
8
  import { type ReadRequest } from "./http-request.reader.js";
@@ -36,7 +36,7 @@ export type OperationRouteResolution = {
36
36
  * is a standard operation the Resource advertises, read through
37
37
  * `isOperationVariantAvailable` alone.
38
38
  */
39
- export declare function resolveOperationRoute(contracts: AvContracts, protocol: ClientProtocolIdentity, route: OperationRouteSegments, origin?: RemoteRequestOrigin): OperationRouteResolution;
39
+ export declare function resolveOperationRoute(contracts: AvContracts, protocol: AvRequestProtocol, route: OperationRouteSegments, origin?: RemoteRequestOrigin): OperationRouteResolution;
40
40
  /**
41
41
  * The `/_transactions` route under one client protocol identity: version → hash → the
42
42
  * ClientContract's transaction capability. The route exists only when that capability
@@ -44,14 +44,14 @@ export declare function resolveOperationRoute(contracts: AvContracts, protocol:
44
44
  * it — and is otherwise absent with core's own refusal of a plan. `undefined` when the
45
45
  * route is there.
46
46
  */
47
- export declare function transactionsRouteFailure(contracts: AvContracts, protocol: ClientProtocolIdentity, origin?: RemoteRequestOrigin): AvOperationFailureResponse | undefined;
47
+ export declare function transactionsRouteFailure(contracts: AvContracts, protocol: AvRequestProtocol, origin?: RemoteRequestOrigin): AvOperationFailureResponse | undefined;
48
48
  /**
49
49
  * What a route's checks before its body resolve to: the route a request
50
50
  * reaches, or the framework response that answers it instead.
51
51
  */
52
52
  type RouteCheck<Route> = ({
53
53
  readonly ok: true;
54
- readonly protocol: ClientProtocolIdentity;
54
+ readonly protocol: AvRequestProtocol;
55
55
  } & Route) | {
56
56
  readonly ok: false;
57
57
  readonly response: AvProtocolResponse;
@@ -1,7 +1,7 @@
1
1
  import type { AvContracts } from "../compiler/contract.compiler.js";
2
2
  import type { RemoteRequestOrigin } from "../config/config-layer.js";
3
3
  import type { RemoteOperationRequest } from "../runtime/operation-request.js";
4
- import type { AgentTransactionRequest, ClientTransactionRequest } from "../transactions/transaction-request.js";
4
+ import type { AvAgentTransactionRequest, AvClientTransactionRequest } from "../transactions/transaction-request.js";
5
5
  import type { AvProtocolResponse } from "./http-response.encoder.js";
6
6
  /** One HTTP request as a host hands it to the protocol. */
7
7
  export type AvProtocolRequest = {
@@ -56,7 +56,7 @@ export type DecodedOperationRequest = Extract<DecodedOperation, {
56
56
  ok: true;
57
57
  }>;
58
58
  /** What `protocol.decodeTransaction` answers. */
59
- export type DecodedTransaction = Decoded<ClientTransactionRequest | AgentTransactionRequest>;
59
+ export type DecodedTransaction = Decoded<AvClientTransactionRequest | AvAgentTransactionRequest>;
60
60
  /**
61
61
  * `protocol.decodeOperation(request)` — one operation route's HTTP request as
62
62
  * the client-origin request `framework.execute` takes, or its answer.
@@ -1,4 +1,4 @@
1
- import type { ClientProtocolIdentity } from "../runtime/operation-request.js";
1
+ import type { AvRequestProtocol } from "../runtime/operation-request.js";
2
2
  import type { OperationRouteSegments } from "./absent-route.responder.js";
3
3
  import type { AvProtocolRequest } from "./http-request.decoder.js";
4
4
  import type { AvProtocolResponse } from "./http-response.encoder.js";
@@ -25,7 +25,7 @@ export type ReadRequest = {
25
25
  /** Adopted from `Aventara-Request-Id`, else minted. */
26
26
  readonly requestId: string;
27
27
  /** `undefined` when either identity header is absent (`A2000`). */
28
- readonly protocol: ClientProtocolIdentity | undefined;
28
+ readonly protocol: AvRequestProtocol | undefined;
29
29
  };
30
30
  /** What a value that is not an `AvProtocolRequest` reads as. */
31
31
  export type UnreadableRequest = {
@@ -1,4 +1,4 @@
1
- import type { ClientProtocolIdentity } from "../runtime/operation-request.js";
1
+ import type { AvRequestProtocol } from "../runtime/operation-request.js";
2
2
  /** `AvProtocol.headers` — the header names the protocol owns, as passive data. */
3
3
  export declare const headers: Readonly<{
4
4
  readonly protocolVersion: "Aventara-Protocol-Version";
@@ -22,11 +22,11 @@ export declare function normalizeHeaders(received: ReceivedHeaders): Readonly<Re
22
22
  */
23
23
  export declare function headerValue(normalized: Readonly<Record<string, string>>, name: string): string | undefined;
24
24
  /**
25
- * The identity headers as the `ClientProtocolIdentity` core checks, or `undefined`
25
+ * The identity headers as the `AvRequestProtocol` core checks, or `undefined`
26
26
  * when either is ABSENT — a request without them is malformed: it does not say which
27
27
  * protocol and ClientContract it speaks, so there is nothing to compare.
28
28
  */
29
- export declare function protocolIdentityOf(normalized: Readonly<Record<string, string>>): ClientProtocolIdentity | undefined;
29
+ export declare function protocolIdentityOf(normalized: Readonly<Record<string, string>>): AvRequestProtocol | undefined;
30
30
  /**
31
31
  * The identity headers a request did not send, in the order the framework sends them —
32
32
  * what the `A2000` answering it names. Empty exactly when {@link protocolIdentityOf}
@@ -21,6 +21,11 @@ export type PlannedReadOperation = {
21
21
  readonly projection: ReadProjectionPlan | undefined;
22
22
  readonly materialize: boolean;
23
23
  };
24
+ /**
25
+ * The fields a level returns when it states no projection: every scalar of the
26
+ * active Contract whose `select` is `true` and that is not governed.
27
+ */
28
+ export declare function defaultProjectionFields(active: AvContract, resourceName: string): readonly string[];
24
29
  /**
25
30
  * Clone the caller projection into the internal Adapter projection: the read
26
31
  * set the Adapter is asked for, always explicit for a projecting variant, plus
@@ -33,5 +38,5 @@ export declare function planReadOperation(core: AvContractCore, model: AvAdapter
33
38
  * Materialize computed scalar reads and remove internal dependency fields,
34
39
  * against `active` — the Contract `planReadOperation` was given as `active`.
35
40
  */
36
- export declare function materializeReadOperation(active: AvContract, compute: ResolvedComputeConfig | undefined, request: OperationExecutionRequest, plan: PlannedReadOperation, value: unknown, contextFactory: ContextFactory): Promise<unknown>;
41
+ export declare function materializeReadOperation(active: AvContract, compute: ResolvedComputeConfig | undefined, _request: OperationExecutionRequest, plan: PlannedReadOperation, value: unknown, contextFactory: ContextFactory): Promise<unknown>;
37
42
  export {};