@tinycloud/operations 0.1.0-beta.1
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/coverage.json +136 -0
- package/dist/artifacts.cjs +7072 -0
- package/dist/artifacts.cjs.map +1 -0
- package/dist/artifacts.d.cts +391 -0
- package/dist/artifacts.d.ts +391 -0
- package/dist/artifacts.js +7054 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/cli-runtime.cjs +9604 -0
- package/dist/cli-runtime.cjs.map +1 -0
- package/dist/cli-runtime.d.cts +9 -0
- package/dist/cli-runtime.d.ts +9 -0
- package/dist/cli-runtime.js +9609 -0
- package/dist/cli-runtime.js.map +1 -0
- package/dist/contract-mCY8LFFI.d.cts +97 -0
- package/dist/contract-mCY8LFFI.d.ts +97 -0
- package/dist/index.cjs +9381 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +9386 -0
- package/dist/index.js.map +1 -0
- package/dist/profile.cjs +194 -0
- package/dist/profile.cjs.map +1 -0
- package/dist/profile.d.cts +61 -0
- package/dist/profile.d.ts +61 -0
- package/dist/profile.js +171 -0
- package/dist/profile.js.map +1 -0
- package/dist/secret-capabilities.cjs +36 -0
- package/dist/secret-capabilities.cjs.map +1 -0
- package/dist/secret-capabilities.d.cts +6 -0
- package/dist/secret-capabilities.d.ts +6 -0
- package/dist/secret-capabilities.js +10 -0
- package/dist/secret-capabilities.js.map +1 -0
- package/dist/state.cjs +381 -0
- package/dist/state.cjs.map +1 -0
- package/dist/state.d.cts +79 -0
- package/dist/state.d.ts +79 -0
- package/dist/state.js +337 -0
- package/dist/state.js.map +1 -0
- package/generated/operations.json +6082 -0
- package/package.json +76 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { PermissionEntry } from '@tinycloud/sdk-core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { T as TinyCloudPosture, O as OperationOperatorType } from './contract-mCY8LFFI.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A capability in the canonical form persisted in a v1 request artifact.
|
|
7
|
+
*
|
|
8
|
+
* The SDK remains the semantic authority for containment. This module only
|
|
9
|
+
* establishes deterministic exact identity for persistence and display.
|
|
10
|
+
*/
|
|
11
|
+
type CanonicalPermissionEntry = Readonly<PermissionEntry>;
|
|
12
|
+
interface AuthorityEvaluation {
|
|
13
|
+
readonly satisfied: boolean;
|
|
14
|
+
readonly missing: readonly CanonicalPermissionEntry[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Operation-owned space resolution. The SDK's general capability evaluator
|
|
18
|
+
* intentionally preserves its historical short/full-space compatibility; the
|
|
19
|
+
* operation kernel supplies this narrower resolver when a space identifies a
|
|
20
|
+
* remote owner's resource.
|
|
21
|
+
*/
|
|
22
|
+
type OperationSpaceResolver = (space: string) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Evaluates required authority with the SDK's public subset primitive.
|
|
25
|
+
*
|
|
26
|
+
* In particular, this intentionally does not implement matching rules or
|
|
27
|
+
* manufacture wildcards. A wildcard can cover a requirement only when it was
|
|
28
|
+
* already present in the supplied granted authority and the SDK says so.
|
|
29
|
+
*/
|
|
30
|
+
declare function evaluateAuthority(granted: readonly PermissionEntry[], required: readonly PermissionEntry[]): AuthorityEvaluation;
|
|
31
|
+
|
|
32
|
+
/** The shared wire schema for SDK PermissionEntry values, including signed ReCap caveats. */
|
|
33
|
+
declare const PermissionEntrySchema: z.ZodObject<{
|
|
34
|
+
service: z.ZodString;
|
|
35
|
+
space: z.ZodOptional<z.ZodString>;
|
|
36
|
+
path: z.ZodString;
|
|
37
|
+
actions: z.ZodArray<z.ZodString, "many">;
|
|
38
|
+
caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
39
|
+
skipPrefix: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
expiry: z.ZodOptional<z.ZodString>;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
service: string;
|
|
44
|
+
path: string;
|
|
45
|
+
actions: string[];
|
|
46
|
+
space?: string | undefined;
|
|
47
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
48
|
+
skipPrefix?: boolean | undefined;
|
|
49
|
+
expiry?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
service: string;
|
|
53
|
+
path: string;
|
|
54
|
+
actions: string[];
|
|
55
|
+
space?: string | undefined;
|
|
56
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
57
|
+
skipPrefix?: boolean | undefined;
|
|
58
|
+
expiry?: string | undefined;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
declare const LegacyPermissionRequestArtifactSchema: z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"tinycloud.auth.request">;
|
|
63
|
+
version: z.ZodLiteral<1>;
|
|
64
|
+
requestId: z.ZodString;
|
|
65
|
+
sessionDid: z.ZodString;
|
|
66
|
+
requested: z.ZodArray<z.ZodObject<{
|
|
67
|
+
service: z.ZodString;
|
|
68
|
+
space: z.ZodOptional<z.ZodString>;
|
|
69
|
+
path: z.ZodString;
|
|
70
|
+
actions: z.ZodArray<z.ZodString, "many">;
|
|
71
|
+
caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
72
|
+
skipPrefix: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
expiry: z.ZodOptional<z.ZodString>;
|
|
74
|
+
description: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strict", z.ZodTypeAny, {
|
|
76
|
+
service: string;
|
|
77
|
+
path: string;
|
|
78
|
+
actions: string[];
|
|
79
|
+
space?: string | undefined;
|
|
80
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
81
|
+
skipPrefix?: boolean | undefined;
|
|
82
|
+
expiry?: string | undefined;
|
|
83
|
+
description?: string | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
service: string;
|
|
86
|
+
path: string;
|
|
87
|
+
actions: string[];
|
|
88
|
+
space?: string | undefined;
|
|
89
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
90
|
+
skipPrefix?: boolean | undefined;
|
|
91
|
+
expiry?: string | undefined;
|
|
92
|
+
description?: string | undefined;
|
|
93
|
+
}>, "many">;
|
|
94
|
+
requestedExpiry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
95
|
+
}, "strict", z.ZodTypeAny, {
|
|
96
|
+
kind: "tinycloud.auth.request";
|
|
97
|
+
version: 1;
|
|
98
|
+
requestId: string;
|
|
99
|
+
sessionDid: string;
|
|
100
|
+
requested: {
|
|
101
|
+
service: string;
|
|
102
|
+
path: string;
|
|
103
|
+
actions: string[];
|
|
104
|
+
space?: string | undefined;
|
|
105
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
106
|
+
skipPrefix?: boolean | undefined;
|
|
107
|
+
expiry?: string | undefined;
|
|
108
|
+
description?: string | undefined;
|
|
109
|
+
}[];
|
|
110
|
+
requestedExpiry?: string | number | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
kind: "tinycloud.auth.request";
|
|
113
|
+
version: 1;
|
|
114
|
+
requestId: string;
|
|
115
|
+
sessionDid: string;
|
|
116
|
+
requested: {
|
|
117
|
+
service: string;
|
|
118
|
+
path: string;
|
|
119
|
+
actions: string[];
|
|
120
|
+
space?: string | undefined;
|
|
121
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
122
|
+
skipPrefix?: boolean | undefined;
|
|
123
|
+
expiry?: string | undefined;
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
}[];
|
|
126
|
+
requestedExpiry?: string | number | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
/** Canonical wire-format v1 request retained for CLI and OpenKey compatibility. */
|
|
129
|
+
declare const PermissionRequestArtifactSchema: z.ZodObject<{
|
|
130
|
+
kind: z.ZodLiteral<"tinycloud.auth.request">;
|
|
131
|
+
version: z.ZodLiteral<1>;
|
|
132
|
+
requestId: z.ZodString;
|
|
133
|
+
createdAt: z.ZodString;
|
|
134
|
+
profile: z.ZodString;
|
|
135
|
+
posture: z.ZodEnum<["owner-openkey", "delegate-session", "local-owner-key", "unauthenticated"]>;
|
|
136
|
+
operatorType: z.ZodEnum<["human", "agent"]>;
|
|
137
|
+
host: z.ZodString;
|
|
138
|
+
sessionDid: z.ZodString;
|
|
139
|
+
ownerDid: z.ZodOptional<z.ZodString>;
|
|
140
|
+
spaceId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
requestedExpiry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
142
|
+
requested: z.ZodArray<z.ZodObject<{
|
|
143
|
+
service: z.ZodString;
|
|
144
|
+
space: z.ZodOptional<z.ZodString>;
|
|
145
|
+
path: z.ZodString;
|
|
146
|
+
actions: z.ZodArray<z.ZodString, "many">;
|
|
147
|
+
caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
148
|
+
skipPrefix: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
expiry: z.ZodOptional<z.ZodString>;
|
|
150
|
+
description: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, "strict", z.ZodTypeAny, {
|
|
152
|
+
service: string;
|
|
153
|
+
path: string;
|
|
154
|
+
actions: string[];
|
|
155
|
+
space?: string | undefined;
|
|
156
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
157
|
+
skipPrefix?: boolean | undefined;
|
|
158
|
+
expiry?: string | undefined;
|
|
159
|
+
description?: string | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
service: string;
|
|
162
|
+
path: string;
|
|
163
|
+
actions: string[];
|
|
164
|
+
space?: string | undefined;
|
|
165
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
166
|
+
skipPrefix?: boolean | undefined;
|
|
167
|
+
expiry?: string | undefined;
|
|
168
|
+
description?: string | undefined;
|
|
169
|
+
}>, "many">;
|
|
170
|
+
command: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
argv: z.ZodArray<z.ZodString, "many">;
|
|
172
|
+
cwd: z.ZodString;
|
|
173
|
+
}, "strict", z.ZodTypeAny, {
|
|
174
|
+
argv: string[];
|
|
175
|
+
cwd: string;
|
|
176
|
+
}, {
|
|
177
|
+
argv: string[];
|
|
178
|
+
cwd: string;
|
|
179
|
+
}>>;
|
|
180
|
+
}, "strict", z.ZodTypeAny, {
|
|
181
|
+
kind: "tinycloud.auth.request";
|
|
182
|
+
version: 1;
|
|
183
|
+
requestId: string;
|
|
184
|
+
sessionDid: string;
|
|
185
|
+
requested: {
|
|
186
|
+
service: string;
|
|
187
|
+
path: string;
|
|
188
|
+
actions: string[];
|
|
189
|
+
space?: string | undefined;
|
|
190
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
191
|
+
skipPrefix?: boolean | undefined;
|
|
192
|
+
expiry?: string | undefined;
|
|
193
|
+
description?: string | undefined;
|
|
194
|
+
}[];
|
|
195
|
+
host: string;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
profile: string;
|
|
198
|
+
posture: "owner-openkey" | "delegate-session" | "local-owner-key" | "unauthenticated";
|
|
199
|
+
operatorType: "human" | "agent";
|
|
200
|
+
requestedExpiry?: string | number | undefined;
|
|
201
|
+
spaceId?: string | undefined;
|
|
202
|
+
ownerDid?: string | undefined;
|
|
203
|
+
command?: {
|
|
204
|
+
argv: string[];
|
|
205
|
+
cwd: string;
|
|
206
|
+
} | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
kind: "tinycloud.auth.request";
|
|
209
|
+
version: 1;
|
|
210
|
+
requestId: string;
|
|
211
|
+
sessionDid: string;
|
|
212
|
+
requested: {
|
|
213
|
+
service: string;
|
|
214
|
+
path: string;
|
|
215
|
+
actions: string[];
|
|
216
|
+
space?: string | undefined;
|
|
217
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
218
|
+
skipPrefix?: boolean | undefined;
|
|
219
|
+
expiry?: string | undefined;
|
|
220
|
+
description?: string | undefined;
|
|
221
|
+
}[];
|
|
222
|
+
host: string;
|
|
223
|
+
createdAt: string;
|
|
224
|
+
profile: string;
|
|
225
|
+
posture: "owner-openkey" | "delegate-session" | "local-owner-key" | "unauthenticated";
|
|
226
|
+
operatorType: "human" | "agent";
|
|
227
|
+
requestedExpiry?: string | number | undefined;
|
|
228
|
+
spaceId?: string | undefined;
|
|
229
|
+
ownerDid?: string | undefined;
|
|
230
|
+
command?: {
|
|
231
|
+
argv: string[];
|
|
232
|
+
cwd: string;
|
|
233
|
+
} | undefined;
|
|
234
|
+
}>;
|
|
235
|
+
/** Canonical structured v1 delegation import accepted by the auth operation. */
|
|
236
|
+
declare const DelegationImportArtifactSchema: z.ZodObject<{
|
|
237
|
+
kind: z.ZodLiteral<"tinycloud.auth.delegation">;
|
|
238
|
+
version: z.ZodLiteral<1>;
|
|
239
|
+
requestId: z.ZodString;
|
|
240
|
+
delegationCid: z.ZodOptional<z.ZodString>;
|
|
241
|
+
delegation: z.ZodType<Record<string, unknown>, z.ZodTypeDef, Record<string, unknown>>;
|
|
242
|
+
permissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
243
|
+
service: z.ZodString;
|
|
244
|
+
space: z.ZodOptional<z.ZodString>;
|
|
245
|
+
path: z.ZodString;
|
|
246
|
+
actions: z.ZodArray<z.ZodString, "many">;
|
|
247
|
+
caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
248
|
+
skipPrefix: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
expiry: z.ZodOptional<z.ZodString>;
|
|
250
|
+
description: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, "strict", z.ZodTypeAny, {
|
|
252
|
+
service: string;
|
|
253
|
+
path: string;
|
|
254
|
+
actions: string[];
|
|
255
|
+
space?: string | undefined;
|
|
256
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
257
|
+
skipPrefix?: boolean | undefined;
|
|
258
|
+
expiry?: string | undefined;
|
|
259
|
+
description?: string | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
service: string;
|
|
262
|
+
path: string;
|
|
263
|
+
actions: string[];
|
|
264
|
+
space?: string | undefined;
|
|
265
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
266
|
+
skipPrefix?: boolean | undefined;
|
|
267
|
+
expiry?: string | undefined;
|
|
268
|
+
description?: string | undefined;
|
|
269
|
+
}>, "many">>;
|
|
270
|
+
expiry: z.ZodOptional<z.ZodString>;
|
|
271
|
+
prompted: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
}, "strict", z.ZodTypeAny, {
|
|
273
|
+
kind: "tinycloud.auth.delegation";
|
|
274
|
+
version: 1;
|
|
275
|
+
requestId: string;
|
|
276
|
+
delegation: Record<string, unknown>;
|
|
277
|
+
expiry?: string | undefined;
|
|
278
|
+
delegationCid?: string | undefined;
|
|
279
|
+
permissions?: {
|
|
280
|
+
service: string;
|
|
281
|
+
path: string;
|
|
282
|
+
actions: string[];
|
|
283
|
+
space?: string | undefined;
|
|
284
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
285
|
+
skipPrefix?: boolean | undefined;
|
|
286
|
+
expiry?: string | undefined;
|
|
287
|
+
description?: string | undefined;
|
|
288
|
+
}[] | undefined;
|
|
289
|
+
prompted?: boolean | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
kind: "tinycloud.auth.delegation";
|
|
292
|
+
version: 1;
|
|
293
|
+
requestId: string;
|
|
294
|
+
delegation: Record<string, unknown>;
|
|
295
|
+
expiry?: string | undefined;
|
|
296
|
+
delegationCid?: string | undefined;
|
|
297
|
+
permissions?: {
|
|
298
|
+
service: string;
|
|
299
|
+
path: string;
|
|
300
|
+
actions: string[];
|
|
301
|
+
space?: string | undefined;
|
|
302
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
303
|
+
skipPrefix?: boolean | undefined;
|
|
304
|
+
expiry?: string | undefined;
|
|
305
|
+
description?: string | undefined;
|
|
306
|
+
}[] | undefined;
|
|
307
|
+
prompted?: boolean | undefined;
|
|
308
|
+
}>;
|
|
309
|
+
type PermissionRequestArtifact = z.infer<typeof PermissionRequestArtifactSchema>;
|
|
310
|
+
type DelegationImportArtifact = z.infer<typeof DelegationImportArtifactSchema>;
|
|
311
|
+
/** The minimal public node-sdk request shape accepted by the legacy reader. */
|
|
312
|
+
type LegacyPermissionRequestArtifact = z.infer<typeof LegacyPermissionRequestArtifactSchema>;
|
|
313
|
+
type ArtifactClock = () => Date;
|
|
314
|
+
type RequestIdSource = () => string;
|
|
315
|
+
/** Invocation-owned values used to safely complete a legacy request record. */
|
|
316
|
+
interface LegacyRequestContext {
|
|
317
|
+
readonly profile: string;
|
|
318
|
+
readonly host: string;
|
|
319
|
+
readonly sessionDid: string;
|
|
320
|
+
readonly posture: TinyCloudPosture;
|
|
321
|
+
readonly operatorType: OperationOperatorType;
|
|
322
|
+
readonly ownerDid?: string;
|
|
323
|
+
readonly spaceId?: string;
|
|
324
|
+
readonly now?: Date;
|
|
325
|
+
}
|
|
326
|
+
interface PermissionRequestIdentityInput {
|
|
327
|
+
readonly profile: string;
|
|
328
|
+
readonly sessionDid: string;
|
|
329
|
+
readonly host: string;
|
|
330
|
+
readonly missing: readonly PermissionEntry[];
|
|
331
|
+
}
|
|
332
|
+
interface BuildPermissionRequestArtifactInput extends PermissionRequestIdentityInput {
|
|
333
|
+
readonly posture: TinyCloudPosture;
|
|
334
|
+
readonly operatorType: OperationOperatorType;
|
|
335
|
+
readonly ownerDid?: string;
|
|
336
|
+
readonly spaceId?: string;
|
|
337
|
+
readonly requestedExpiry?: string | number;
|
|
338
|
+
readonly command?: {
|
|
339
|
+
readonly argv: readonly string[];
|
|
340
|
+
readonly cwd: string;
|
|
341
|
+
};
|
|
342
|
+
readonly now?: ArtifactClock;
|
|
343
|
+
readonly createRequestId?: RequestIdSource;
|
|
344
|
+
}
|
|
345
|
+
interface CreateOrReusePermissionRequestInput extends BuildPermissionRequestArtifactInput {
|
|
346
|
+
readonly granted: readonly PermissionEntry[];
|
|
347
|
+
/** Owner-aware identity resolver used by registered operation callers. */
|
|
348
|
+
readonly resolveSpace?: OperationSpaceResolver;
|
|
349
|
+
readonly replace?: boolean;
|
|
350
|
+
}
|
|
351
|
+
type PermissionRequestResolution = Readonly<{
|
|
352
|
+
status: "satisfied";
|
|
353
|
+
reused: false;
|
|
354
|
+
}> | Readonly<{
|
|
355
|
+
status: "created";
|
|
356
|
+
reused: boolean;
|
|
357
|
+
request: PermissionRequestArtifact;
|
|
358
|
+
}>;
|
|
359
|
+
/** Parses a request artifact without accepting a newer wire format as v1. */
|
|
360
|
+
declare function validatePermissionRequestArtifact(value: unknown): PermissionRequestArtifact;
|
|
361
|
+
/** Parses a structured active-session import artifact without accepting a newer wire format as v1. */
|
|
362
|
+
declare function validateDelegationImportArtifact(value: unknown): DelegationImportArtifact;
|
|
363
|
+
declare function isPermissionRequestArtifact(value: unknown): value is PermissionRequestArtifact;
|
|
364
|
+
declare function isDelegationImportArtifact(value: unknown): value is DelegationImportArtifact;
|
|
365
|
+
/**
|
|
366
|
+
* Stable exact identity used only for request reuse. It binds a request to its
|
|
367
|
+
* selected profile, active session DID, host, and canonical missing subset.
|
|
368
|
+
*/
|
|
369
|
+
declare function createPermissionRequestIdentity(input: PermissionRequestIdentityInput): string;
|
|
370
|
+
/** Builds an on-disk-compatible v1 record. Omitted values stay omitted. */
|
|
371
|
+
declare function buildPermissionRequestArtifact(input: BuildPermissionRequestArtifactInput): PermissionRequestArtifact;
|
|
372
|
+
/** Reads only valid canonical v1 records and refuses malformed stored artifacts. */
|
|
373
|
+
declare function listPermissionRequests(profile: string, context?: LegacyRequestContext): Promise<PermissionRequestArtifact[]>;
|
|
374
|
+
declare function findPermissionRequest(profile: string, requestId: string, identity: Pick<PermissionRequestIdentityInput, "sessionDid" | "host"> & Partial<Omit<LegacyRequestContext, "profile" | "host" | "sessionDid">>): Promise<PermissionRequestArtifact | null>;
|
|
375
|
+
/**
|
|
376
|
+
* Atomically returns the newest identical unresolved request, or writes a new
|
|
377
|
+
* v1 record. Retention, stale-session pruning, covered-record pruning, and
|
|
378
|
+
* partial-grant supersession all happen in the same existing profile lock.
|
|
379
|
+
*/
|
|
380
|
+
declare function createOrReusePermissionRequest(input: CreateOrReusePermissionRequestInput): Promise<PermissionRequestResolution>;
|
|
381
|
+
interface PrunePermissionRequestsInput {
|
|
382
|
+
readonly profile: string;
|
|
383
|
+
readonly sessionDid: string;
|
|
384
|
+
readonly granted: readonly PermissionEntry[];
|
|
385
|
+
readonly resolveSpace?: OperationSpaceResolver;
|
|
386
|
+
readonly now: Date;
|
|
387
|
+
}
|
|
388
|
+
/** Pure retention policy used by the locked persistence operation. */
|
|
389
|
+
declare function prunePermissionRequests(records: readonly PermissionRequestArtifact[], input: PrunePermissionRequestsInput): PermissionRequestArtifact[];
|
|
390
|
+
|
|
391
|
+
export { type ArtifactClock, type BuildPermissionRequestArtifactInput, type CreateOrReusePermissionRequestInput, type DelegationImportArtifact, DelegationImportArtifactSchema, type LegacyPermissionRequestArtifact, type LegacyRequestContext, PermissionEntrySchema, type PermissionRequestArtifact, PermissionRequestArtifactSchema, type PermissionRequestIdentityInput, type PermissionRequestResolution, type PrunePermissionRequestsInput, type RequestIdSource, buildPermissionRequestArtifact, createOrReusePermissionRequest, createPermissionRequestIdentity, evaluateAuthority, findPermissionRequest, isDelegationImportArtifact, isPermissionRequestArtifact, listPermissionRequests, prunePermissionRequests, validateDelegationImportArtifact, validatePermissionRequestArtifact };
|