@knitli/openapi-mcp 0.0.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 (116) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +362 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.js +249 -0
  6. package/dist/compile.d.ts +14 -0
  7. package/dist/compile.js +132 -0
  8. package/dist/compiler.d.ts +13 -0
  9. package/dist/compiler.js +7 -0
  10. package/dist/conformance/fixtures.d.ts +24 -0
  11. package/dist/conformance/fixtures.js +119 -0
  12. package/dist/conformance/index.d.ts +2 -0
  13. package/dist/conformance/index.js +2 -0
  14. package/dist/conformance/runtime-suite.d.ts +31 -0
  15. package/dist/conformance/runtime-suite.js +343 -0
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +1 -0
  18. package/dist/load.d.ts +31 -0
  19. package/dist/load.js +20 -0
  20. package/dist/operations.d.ts +27 -0
  21. package/dist/operations.js +231 -0
  22. package/dist/permissions.d.ts +31 -0
  23. package/dist/permissions.js +89 -0
  24. package/dist/release/compile-release.d.ts +33 -0
  25. package/dist/release/compile-release.js +1620 -0
  26. package/dist/release/load-v4.d.ts +29 -0
  27. package/dist/release/load-v4.js +297 -0
  28. package/dist/release/manifest-builder.d.ts +19 -0
  29. package/dist/release/manifest-builder.js +28 -0
  30. package/dist/release/publish.d.ts +45 -0
  31. package/dist/release/publish.js +346 -0
  32. package/dist/release/reference-map.d.ts +53 -0
  33. package/dist/release/reference-map.js +347 -0
  34. package/dist/release/schema-v4.d.ts +5 -0
  35. package/dist/release/schema-v4.js +91 -0
  36. package/dist/runtime/action-permit.d.ts +11 -0
  37. package/dist/runtime/action-permit.js +1 -0
  38. package/dist/runtime/classify.d.ts +16 -0
  39. package/dist/runtime/classify.js +279 -0
  40. package/dist/runtime/credential-binding.d.ts +3 -0
  41. package/dist/runtime/credential-binding.js +101 -0
  42. package/dist/runtime/digest.d.ts +8 -0
  43. package/dist/runtime/digest.js +80 -0
  44. package/dist/runtime/errors.d.ts +14 -0
  45. package/dist/runtime/errors.js +15 -0
  46. package/dist/runtime/index.d.ts +20 -0
  47. package/dist/runtime/index.js +14 -0
  48. package/dist/runtime/manifest.d.ts +33 -0
  49. package/dist/runtime/manifest.js +489 -0
  50. package/dist/runtime/prepared-call.d.ts +39 -0
  51. package/dist/runtime/prepared-call.js +566 -0
  52. package/dist/runtime/references.d.ts +7 -0
  53. package/dist/runtime/references.js +197 -0
  54. package/dist/runtime/runtime.d.ts +25 -0
  55. package/dist/runtime/runtime.js +1272 -0
  56. package/dist/runtime/schema-keywords.d.ts +2 -0
  57. package/dist/runtime/schema-keywords.js +30 -0
  58. package/dist/runtime/schema-resolver.d.ts +10 -0
  59. package/dist/runtime/schema-resolver.js +237 -0
  60. package/dist/runtime/serialize.d.ts +12 -0
  61. package/dist/runtime/serialize.js +877 -0
  62. package/dist/runtime/store.d.ts +52 -0
  63. package/dist/runtime/store.js +582 -0
  64. package/dist/runtime/strict-json.d.ts +19 -0
  65. package/dist/runtime/strict-json.js +539 -0
  66. package/dist/runtime/types.d.ts +457 -0
  67. package/dist/runtime/types.js +1 -0
  68. package/dist/runtime/verify-record.d.ts +6 -0
  69. package/dist/runtime/verify-record.js +492 -0
  70. package/dist/runtime/versions.d.ts +63 -0
  71. package/dist/runtime/versions.js +86 -0
  72. package/dist/safety.d.ts +28 -0
  73. package/dist/safety.js +60 -0
  74. package/dist/schema.d.ts +5 -0
  75. package/dist/schema.js +52 -0
  76. package/dist/schemas.d.ts +9 -0
  77. package/dist/schemas.js +16 -0
  78. package/dist/sign.d.ts +20 -0
  79. package/dist/sign.js +55 -0
  80. package/dist/sqlite/auth.d.ts +33 -0
  81. package/dist/sqlite/auth.js +973 -0
  82. package/dist/sqlite/catalog-store.d.ts +20 -0
  83. package/dist/sqlite/catalog-store.js +370 -0
  84. package/dist/sqlite/destination-guard.d.ts +24 -0
  85. package/dist/sqlite/destination-guard.js +140 -0
  86. package/dist/sqlite/generation-store.d.ts +12 -0
  87. package/dist/sqlite/generation-store.js +721 -0
  88. package/dist/sqlite/guarded-fetch.d.ts +24 -0
  89. package/dist/sqlite/guarded-fetch.js +626 -0
  90. package/dist/sqlite/index.d.ts +5 -0
  91. package/dist/sqlite/index.js +5 -0
  92. package/dist/sqlite/oauth-resource.d.ts +2 -0
  93. package/dist/sqlite/oauth-resource.js +15 -0
  94. package/dist/sqlite/release-completion.d.ts +5 -0
  95. package/dist/sqlite/release-completion.js +80 -0
  96. package/dist/stdio/action-broker.d.ts +15 -0
  97. package/dist/stdio/action-broker.js +136 -0
  98. package/dist/stdio/authorizer.d.ts +30 -0
  99. package/dist/stdio/authorizer.js +484 -0
  100. package/dist/stdio/config.d.ts +77 -0
  101. package/dist/stdio/config.js +144 -0
  102. package/dist/stdio/exact-policy.d.ts +41 -0
  103. package/dist/stdio/exact-policy.js +361 -0
  104. package/dist/stdio/index.d.ts +6 -0
  105. package/dist/stdio/index.js +148 -0
  106. package/dist/stdio/render.d.ts +8 -0
  107. package/dist/stdio/render.js +253 -0
  108. package/dist/stdio/request-state.d.ts +18 -0
  109. package/dist/stdio/request-state.js +79 -0
  110. package/dist/stdio/search.d.ts +10 -0
  111. package/dist/stdio/search.js +76 -0
  112. package/dist/stdio/server.d.ts +29 -0
  113. package/dist/stdio/server.js +309 -0
  114. package/dist/types.d.ts +32 -0
  115. package/dist/types.js +1 -0
  116. package/package.json +131 -0
@@ -0,0 +1,457 @@
1
+ import type { ActionDispatchPermit } from "./action-permit.ts";
2
+ import type { OpenApiMcpErrorCode } from "./errors.ts";
3
+ import type { RuntimeLimits } from "./versions.ts";
4
+ export type Sha256 = string & {
5
+ readonly __sha256: unique symbol;
6
+ };
7
+ export type CatalogId = string & {
8
+ readonly __catalogId: unique symbol;
9
+ };
10
+ export type ReleaseId = string & {
11
+ readonly __releaseId: unique symbol;
12
+ };
13
+ export type TypedOperationId = `operation:${string}`;
14
+ export type TypedSchemaId = `schema:${string}`;
15
+ export type TypedRecordId = TypedOperationId | TypedSchemaId;
16
+ export type OpenApiValue = null | boolean | number | string | OpenApiValue[] | {
17
+ [key: string]: OpenApiValue;
18
+ };
19
+ export type JsonValue = OpenApiValue;
20
+ export type JsonObject = {
21
+ [key: string]: JsonValue;
22
+ };
23
+ export type JsonSchemaV4 = JsonObject | boolean;
24
+ export interface OpenApiArguments {
25
+ path?: Readonly<Record<string, string | number | boolean>>;
26
+ query?: Readonly<Record<string, OpenApiValue>>;
27
+ headers?: Readonly<Record<string, string>>;
28
+ body?: OpenApiValue;
29
+ }
30
+ /** A host-owned transport location reserved for later credential injection. */
31
+ export interface CredentialSlot {
32
+ readonly placement: "header" | "query";
33
+ readonly name: string;
34
+ }
35
+ /** Host-only serializer policy. This is deliberately outside OpenApiArguments. */
36
+ export interface SerializeArgumentsOptions {
37
+ readonly limits?: Readonly<Partial<RuntimeLimits>>;
38
+ readonly reservedCredentialSlots?: readonly CredentialSlot[];
39
+ }
40
+ export type HttpMethod = "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "TRACE";
41
+ export interface ReleaseManifestV4 {
42
+ /** v4 records omit operation tags; v5 records require signed tags. */
43
+ format: 4 | 5;
44
+ contract: 1;
45
+ catalogId: CatalogId;
46
+ releaseId: ReleaseId;
47
+ generation: number;
48
+ issuer: string;
49
+ keyId: string;
50
+ policyId: string;
51
+ allowedOrigins: readonly string[];
52
+ compiledAt: string;
53
+ compilerVersion: string;
54
+ source: {
55
+ uri: string;
56
+ revision: string;
57
+ contentSha256: Sha256;
58
+ referenceGraphDigest: Sha256;
59
+ };
60
+ records: Readonly<Record<TypedRecordId, Sha256>>;
61
+ }
62
+ export interface ManifestSignature {
63
+ algorithm: "Ed25519";
64
+ keyId: string;
65
+ signature: string;
66
+ }
67
+ export interface RollbackAuthorization {
68
+ id: string;
69
+ catalogId: CatalogId;
70
+ issuer: string;
71
+ currentHighestGeneration: number;
72
+ targetGeneration: number;
73
+ targetManifestDigest: Sha256;
74
+ reason: string;
75
+ expiresAt: string;
76
+ keyId: string;
77
+ algorithm: "Ed25519";
78
+ signature: string;
79
+ }
80
+ export interface ManifestEnvelope {
81
+ manifestJson: string;
82
+ signature: ManifestSignature;
83
+ rollback?: RollbackAuthorization;
84
+ }
85
+ export interface StoredRecord<TRecord> {
86
+ id: TypedRecordId;
87
+ logicalDigest: Sha256;
88
+ record: TRecord;
89
+ }
90
+ /** Logical operation data normalized from v4 or admitted through signed v5. */
91
+ export type ParameterLocationV4 = "path" | "query" | "header" | "cookie";
92
+ export type ParameterStyleV4 = "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject";
93
+ export type CanonicalMediaTypeV4 = string & {
94
+ readonly __canonicalMediaTypeV4: unique symbol;
95
+ };
96
+ export type SchemaUseV4 = {
97
+ readonly kind: "schema";
98
+ readonly schemaId: TypedSchemaId;
99
+ } | {
100
+ readonly kind: "content";
101
+ readonly mediaType: CanonicalMediaTypeV4;
102
+ readonly schemaId: TypedSchemaId;
103
+ };
104
+ export interface ParameterRecordV4 {
105
+ readonly name: string;
106
+ readonly in: ParameterLocationV4;
107
+ readonly required: boolean;
108
+ readonly deprecated: boolean;
109
+ readonly style: ParameterStyleV4;
110
+ readonly explode: boolean;
111
+ readonly allowReserved: boolean;
112
+ readonly value: SchemaUseV4;
113
+ }
114
+ export interface EncodingHeaderV4 {
115
+ readonly name: string;
116
+ readonly required: boolean;
117
+ readonly value: SchemaUseV4;
118
+ }
119
+ export interface MediaEncodingV4 {
120
+ readonly property: string;
121
+ readonly contentType: CanonicalMediaTypeV4 | null;
122
+ readonly style: ParameterStyleV4 | null;
123
+ readonly explode: boolean | null;
124
+ readonly allowReserved: boolean;
125
+ readonly headers: readonly EncodingHeaderV4[];
126
+ }
127
+ export interface RequestBodyMediaV4 {
128
+ readonly mediaType: CanonicalMediaTypeV4;
129
+ readonly schemaId: TypedSchemaId;
130
+ readonly encoding: readonly MediaEncodingV4[];
131
+ }
132
+ export interface RequestBodyRecordV4 {
133
+ readonly required: boolean;
134
+ readonly content: readonly RequestBodyMediaV4[];
135
+ }
136
+ export interface OperationRecordV4 {
137
+ id: TypedOperationId;
138
+ api: string;
139
+ operationId: string;
140
+ method: HttpMethod;
141
+ path: string;
142
+ origin: string;
143
+ summary: string | null;
144
+ tags: readonly string[];
145
+ deprecated: boolean;
146
+ parameters: readonly ParameterRecordV4[];
147
+ requestBody: RequestBodyRecordV4 | null;
148
+ schemaIds: readonly TypedSchemaId[];
149
+ advisory: JsonObject;
150
+ }
151
+ /** Logical schema data admitted through a signed v4/v5 manifest. */
152
+ export interface SchemaRecordV4 {
153
+ id: TypedSchemaId;
154
+ schema: JsonSchemaV4;
155
+ }
156
+ export interface SearchQuery {
157
+ query: string;
158
+ api?: string;
159
+ limit: number;
160
+ }
161
+ export interface CandidateRef {
162
+ catalogId: CatalogId;
163
+ releaseId: ReleaseId;
164
+ operationId: TypedOperationId;
165
+ }
166
+ export interface CatalogStore {
167
+ getManifest(catalogId: CatalogId, releaseId: ReleaseId): Promise<ManifestEnvelope>;
168
+ searchCandidates(query: SearchQuery): Promise<readonly CandidateRef[]>;
169
+ getOperation(catalogId: CatalogId, releaseId: ReleaseId, id: TypedOperationId): Promise<StoredRecord<OperationRecordV4> | null>;
170
+ getSchemas(catalogId: CatalogId, releaseId: ReleaseId, ids: readonly TypedSchemaId[]): Promise<readonly StoredRecord<SchemaRecordV4>[]>;
171
+ }
172
+ /** Immutable high-water data plus the release currently admitted for use. */
173
+ export interface GenerationState {
174
+ revision: number;
175
+ highestGeneration: number;
176
+ highestManifestDigest: Sha256;
177
+ activeGeneration: number;
178
+ activeManifestDigest: Sha256;
179
+ consumedRollbackAuthorizationIds: readonly string[];
180
+ }
181
+ /** A compare-and-swap transition expected to move state from one revision. */
182
+ export interface GenerationTransition {
183
+ expectedRevision: number | null;
184
+ next: GenerationState;
185
+ }
186
+ export interface GenerationStore {
187
+ get(catalogId: CatalogId, issuer: string): Promise<GenerationState | null>;
188
+ accept(catalogId: CatalogId, issuer: string, transition: GenerationTransition): Promise<GenerationState | null>;
189
+ }
190
+ export interface OperationRefPayload {
191
+ catalogId: CatalogId;
192
+ releaseId: ReleaseId;
193
+ operationId: TypedOperationId;
194
+ manifestDigest: Sha256;
195
+ }
196
+ /** Opaque `opref.v1.*` wire representation. */
197
+ export type OperationRef = string & {
198
+ readonly __operationRef: unique symbol;
199
+ };
200
+ export interface SearchInput {
201
+ query: string;
202
+ api?: string;
203
+ limit?: number;
204
+ }
205
+ export interface SearchResultItem {
206
+ operation: OperationRef;
207
+ summary: string | null;
208
+ inputOutline: JsonObject;
209
+ safety: "read" | "action";
210
+ actionKind: ActionKind | null;
211
+ cardinality: ActionCardinality | null;
212
+ deprecated: boolean;
213
+ advisory: JsonObject;
214
+ }
215
+ /** A bounded, already-redacted warning emitted while searching candidates. */
216
+ export interface SearchWarning {
217
+ code: OpenApiMcpErrorCode;
218
+ message: string;
219
+ details?: Readonly<Record<string, OpenApiValue>>;
220
+ }
221
+ export interface SearchResult {
222
+ operations: readonly SearchResultItem[];
223
+ warnings: readonly SearchWarning[];
224
+ }
225
+ export interface PrepareInput {
226
+ operation: OperationRef;
227
+ arguments: OpenApiArguments;
228
+ pageToken?: string;
229
+ }
230
+ export type ActionKind = "create" | "update" | "delete" | "communicate" | "authority" | "transaction" | "execute" | "unknown";
231
+ export type ActionCardinality = {
232
+ kind: "single";
233
+ } | {
234
+ kind: "bounded";
235
+ maxAffected: number;
236
+ } | {
237
+ kind: "unbounded";
238
+ } | {
239
+ kind: "unknown";
240
+ };
241
+ export interface PreparedCall {
242
+ version: 2;
243
+ catalogId: CatalogId;
244
+ releaseId: ReleaseId;
245
+ operationId: TypedOperationId;
246
+ operationDigest: Sha256;
247
+ manifestDigest: Sha256;
248
+ /** Stable operator-selected profile identifier; never a user or token identifier. */
249
+ credentialProfileId: string;
250
+ /** Commits the selected profile's complete non-secret configuration. */
251
+ credentialProfileDigest: Sha256;
252
+ /** Binds the host-selected credential injection locations, never secrets. */
253
+ reservedSlotsDigest: Sha256;
254
+ method: HttpMethod;
255
+ origin: string;
256
+ relativeUrl: string;
257
+ /** Opaque continuation proof, bound together with relativeUrl by the call digest. */
258
+ pageToken: string | null;
259
+ headers: Readonly<Record<string, string>>;
260
+ body: Uint8Array | null;
261
+ normalizedArguments: JsonObject;
262
+ safety: "read" | "action";
263
+ actionKind: ActionKind | null;
264
+ cardinality: ActionCardinality | null;
265
+ inputDigest: Sha256;
266
+ preparedCallDigest: Sha256;
267
+ }
268
+ export interface OpenApiRuntime {
269
+ search(input: SearchInput): Promise<SearchResult>;
270
+ prepareRead(input: PrepareInput): Promise<PreparedCall>;
271
+ prepareAction(input: PrepareInput): Promise<PreparedCall>;
272
+ revalidate(call: PreparedCall): Promise<PreparedCall>;
273
+ }
274
+ export type VerifiedActionRequestState = object & {
275
+ readonly __verifiedActionRequestState: unique symbol;
276
+ };
277
+ /** Identity is owned and validated by the configured authorizer. */
278
+ export type AuthorizationId = object & {
279
+ readonly __authorizationId: unique symbol;
280
+ };
281
+ export type AuthorizationContext = {
282
+ readonly kind: "initial";
283
+ } | {
284
+ readonly kind: "resume";
285
+ readonly requestState: VerifiedActionRequestState;
286
+ readonly inputResponses: unknown;
287
+ };
288
+ export interface CredentialAuthorizationBinding {
289
+ readonly profileId: string;
290
+ readonly profileDigest: Sha256;
291
+ readonly grantId: string;
292
+ readonly audience?: string;
293
+ readonly scopes: readonly string[];
294
+ readonly slotsDigest: Sha256;
295
+ readonly bindingDigest: Sha256;
296
+ }
297
+ export interface SafeApprovalPresentation {
298
+ message: string;
299
+ credentialProfile: string;
300
+ audience: string;
301
+ scopes: readonly string[];
302
+ credentialBindingDigest: Sha256;
303
+ policyActivation?: {
304
+ readonly policyDigest: Sha256;
305
+ readonly expiresAt: number;
306
+ };
307
+ catalogId: string;
308
+ releaseId: string;
309
+ operationId: string;
310
+ method: HttpMethod;
311
+ origin: string;
312
+ relativeUrl: string;
313
+ actionKind: ActionKind;
314
+ cardinality: ActionCardinality;
315
+ normalizedArguments: string;
316
+ preparedCallDigest: Sha256;
317
+ }
318
+ export interface ActionAuthorizer {
319
+ authorize(call: PreparedCall, credential: CredentialAuthorizationBinding, context: AuthorizationContext): Promise<AuthorizationDecision>;
320
+ consume(decision: AuthorizedActionDecision, call: PreparedCall, credential: CredentialAuthorizationBinding): Promise<void>;
321
+ }
322
+ export interface AuthorizedActionDecision {
323
+ readonly status: "authorized";
324
+ readonly callDigest: Sha256;
325
+ readonly credentialBindingDigest: Sha256;
326
+ readonly path: "per-call" | "exact-policy";
327
+ readonly authorizationId: AuthorizationId;
328
+ readonly policyDigest?: Sha256;
329
+ }
330
+ export type AuthorizationDecision = AuthorizedActionDecision | {
331
+ status: "input-required";
332
+ presentation: SafeApprovalPresentation;
333
+ requestState: string;
334
+ } | {
335
+ status: "denied";
336
+ reason: string;
337
+ };
338
+ export type AuthProfile = {
339
+ type: "bearer-env";
340
+ env: string;
341
+ } | {
342
+ type: "api-key-env";
343
+ env: string;
344
+ placement: "header" | "query";
345
+ name: string;
346
+ } | {
347
+ type: "oauth2-pkce";
348
+ authorizationEndpoint: string;
349
+ tokenEndpoint: string;
350
+ clientId: string;
351
+ scopes: readonly string[];
352
+ resource?: string;
353
+ };
354
+ /** Complete trusted, non-secret configuration for one local upstream identity. */
355
+ export interface LocalAuthProfile {
356
+ readonly profileId: string;
357
+ readonly revision: number;
358
+ readonly allowedOrigins: readonly string[];
359
+ readonly auth: AuthProfile;
360
+ readonly audience?: string;
361
+ /** Environment-profile scopes only; OAuth scopes are declared by auth.scopes. */
362
+ readonly scopes?: readonly string[];
363
+ }
364
+ export interface SecretStore {
365
+ get(key: string): Promise<string | null>;
366
+ set(key: string, value: string): Promise<void>;
367
+ delete(key: string): Promise<void>;
368
+ }
369
+ export type Credential = {
370
+ type: "bearer";
371
+ token: string;
372
+ } | {
373
+ type: "api-key";
374
+ placement: "header" | "query";
375
+ name: string;
376
+ value: string;
377
+ };
378
+ /** Host-internal only. This secret-bearing value must never enter MCP output. */
379
+ export interface CredentialSnapshot {
380
+ readonly credential: Credential;
381
+ readonly binding: CredentialAuthorizationBinding;
382
+ }
383
+ export type CredentialResolution = {
384
+ status: "ready";
385
+ snapshot: CredentialSnapshot;
386
+ } | {
387
+ status: "auth-required";
388
+ authorizationUrl: string;
389
+ expiresAt: string;
390
+ };
391
+ export interface CredentialProvider {
392
+ resolve(): Promise<CredentialResolution>;
393
+ }
394
+ export interface DestinationPolicy {
395
+ allows(origin: string): Promise<boolean>;
396
+ }
397
+ /** Exact verified operation identity exposed to host credential-slot policy. */
398
+ export interface CredentialSlotContext {
399
+ readonly catalogId: CatalogId;
400
+ readonly releaseId: ReleaseId;
401
+ readonly operationId: TypedOperationId;
402
+ readonly operationDigest: Sha256;
403
+ readonly manifestDigest: Sha256;
404
+ readonly method: HttpMethod;
405
+ readonly origin: string;
406
+ }
407
+ /**
408
+ * Host-owned policy for selecting a non-secret credential profile commitment.
409
+ * Implementations return a profile ID, profile digest, and injection slots;
410
+ * credentials never enter preparation.
411
+ */
412
+ export interface CredentialProfileBinding {
413
+ readonly profileId: string;
414
+ readonly profileDigest: Sha256;
415
+ readonly slots: readonly CredentialSlot[];
416
+ }
417
+ export interface CredentialBindingResolver {
418
+ resolve(context: Readonly<CredentialSlotContext>): Promise<CredentialProfileBinding>;
419
+ }
420
+ export interface PaginationTokenState {
421
+ catalogId: CatalogId;
422
+ releaseId: ReleaseId;
423
+ manifestDigest: Sha256;
424
+ operationId: TypedOperationId;
425
+ inputDigest: Sha256;
426
+ origin: string;
427
+ nextRelativeUrl: string;
428
+ expiresAt: string;
429
+ pageCount: number;
430
+ cumulativeBytes: number;
431
+ }
432
+ /** Host-owned codec; decode must authenticate every field and reject expired tokens. */
433
+ export interface PaginationTokenCodec {
434
+ encode(state: PaginationTokenState): Promise<string>;
435
+ decode(token: string): Promise<PaginationTokenState>;
436
+ }
437
+ export type CallOutcome = {
438
+ kind: "success";
439
+ statusCode: number;
440
+ headers: Readonly<Record<string, string>>;
441
+ body: Uint8Array;
442
+ pageToken?: string;
443
+ } | {
444
+ kind: "redirect-blocked";
445
+ location: string | null;
446
+ } | {
447
+ kind: "not-modified";
448
+ };
449
+ export type PreparedDispatch = object & {
450
+ readonly __preparedDispatch: unique symbol;
451
+ };
452
+ export interface AuthorizedTransport {
453
+ prepareDispatch(call: PreparedCall, credential: CredentialSnapshot): Promise<PreparedDispatch>;
454
+ verifyPlan(plan: PreparedDispatch, call: PreparedCall, credential: CredentialAuthorizationBinding): void;
455
+ dispatchRead(plan: PreparedDispatch): Promise<CallOutcome>;
456
+ dispatchAction(plan: PreparedDispatch, permit: ActionDispatchPermit): Promise<CallOutcome>;
457
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { AdmittedManifest } from "./manifest.ts";
2
+ import type { OperationRecordV4, SchemaRecordV4, StoredRecord } from "./types.ts";
3
+ import { type RuntimeLimits } from "./versions.ts";
4
+ export declare function parseOperationPathTemplateV4(path: string): readonly string[];
5
+ /** Reconstruct, hash, admit, detach, and freeze one untrusted store row. */
6
+ export declare function verifyStoredRecord<T extends OperationRecordV4 | SchemaRecordV4>(admitted: AdmittedManifest, rowValue: StoredRecord<T>, limitOverrides?: Partial<RuntimeLimits>): Promise<Readonly<T>>;